diff options
author | Craig Tiller <ctiller@google.com> | 2017-10-15 22:32:32 +0000 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-10-15 22:32:32 +0000 |
commit | 1f708a6adef0a34feeb8641c328ae05f1e81d461 (patch) | |
tree | edf16609fc063d45a4489ef0717f967d09f6125e /src/core/lib/iomgr | |
parent | 1406f9c524029b5725dfc578551366e54c6494fb (diff) |
Prefer to kick waiters not pollers
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r-- | src/core/lib/iomgr/ev_epollex_linux.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc index bc2e665f06..07ba9dd2cc 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ b/src/core/lib/iomgr/ev_epollex_linux.cc @@ -557,11 +557,13 @@ static grpc_error *pollset_kick_one(grpc_exec_ctx *exec_ctx, grpc_pollset_worker *specific_worker) { pollable *p = specific_worker->pollable_obj; grpc_core::mu_guard lock(&p->mu); +GRPC_STATS_INC_POLLSET_KICK(exec_ctx); GPR_ASSERT(specific_worker != NULL); if (specific_worker->kicked) { if (GRPC_TRACER_ON(grpc_polling_trace)) { gpr_log(GPR_DEBUG, "PS:%p kicked_specific_but_already_kicked", p); } +GRPC_STATS_INC_POLLSET_KICKED_AGAIN(exec_ctx); return GRPC_ERROR_NONE; } if (gpr_tls_get(&g_current_thread_worker) == @@ -569,10 +571,12 @@ static grpc_error *pollset_kick_one(grpc_exec_ctx *exec_ctx, if (GRPC_TRACER_ON(grpc_polling_trace)) { gpr_log(GPR_DEBUG, "PS:%p kicked_specific_but_awake", p); } +GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(exec_ctx); specific_worker->kicked = true; return GRPC_ERROR_NONE; } if (specific_worker == p->root_worker) { +GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(exec_ctx); if (GRPC_TRACER_ON(grpc_polling_trace)) { gpr_log(GPR_DEBUG, "PS:%p kicked_specific_via_wakeup_fd", p); } @@ -581,6 +585,7 @@ if (specific_worker == p->root_worker) { return error; } if (specific_worker->initialized_cv) { +GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(exec_ctx); if (GRPC_TRACER_ON(grpc_polling_trace)) { gpr_log(GPR_DEBUG, "PS:%p kicked_specific_via_cv", p); } @@ -611,7 +616,7 @@ static grpc_error *pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, pollset->kicked_without_poller = true; return GRPC_ERROR_NONE; } else { - return pollset_kick_one(exec_ctx, pollset, pollset->root_worker); + return pollset_kick_one(exec_ctx, pollset, pollset->root_worker->links[PWLINK_POLLSET].next); } } else { if (GRPC_TRACER_ON(grpc_polling_trace)) { |