Merge pull request #15386 from yang-g/kernel_y_u_no_fair

Round robin incoming connection on a per-fd basis
pull/15344/merge
Yang Gao 7 years ago committed by GitHub
commit b3e3ed3203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/core/lib/iomgr/tcp_server_posix.cc

@ -187,11 +187,6 @@ static void on_read(void* arg, grpc_error* err) {
goto error; goto error;
} }
read_notifier_pollset =
sp->server->pollsets[static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
&sp->server->next_pollset_to_assign, 1)) %
sp->server->pollset_count];
/* loop until accept4 returns EAGAIN, and then re-arm notification */ /* loop until accept4 returns EAGAIN, and then re-arm notification */
for (;;) { for (;;) {
grpc_resolved_address addr; grpc_resolved_address addr;
@ -233,6 +228,11 @@ static void on_read(void* arg, grpc_error* err) {
grpc_fd* fdobj = grpc_fd_create(fd, name); grpc_fd* fdobj = grpc_fd_create(fd, name);
read_notifier_pollset =
sp->server->pollsets[static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
&sp->server->next_pollset_to_assign, 1)) %
sp->server->pollset_count];
grpc_pollset_add_fd(read_notifier_pollset, fdobj); grpc_pollset_add_fd(read_notifier_pollset, fdobj);
// Create acceptor. // Create acceptor.

Loading…
Cancel
Save