From cf34fa58f476aae77c4e2dca0ff866542dd3af28 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 13 Sep 2017 12:37:01 -0700 Subject: [PATCH] Document only epoll1 for these stats, add missing spot --- src/core/lib/debug/stats_data.c | 14 ++++++++------ src/core/lib/debug/stats_data.yaml | 6 ++++++ src/core/lib/iomgr/ev_epoll1_linux.c | 8 +++++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/core/lib/debug/stats_data.c b/src/core/lib/debug/stats_data.c index fc1ac223de3..1a020a15c38 100644 --- a/src/core/lib/debug/stats_data.c +++ b/src/core/lib/debug/stats_data.c @@ -70,16 +70,18 @@ const char *grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = { "Number of server side calls created by this process", "Number of polling syscalls (epoll_wait, poll, etc) made by this process", "Number of sleeping syscalls made by this process", - "How many polling wakeups were performed by the process", - "How many times was a polling wakeup requested without an active poller", + "How many polling wakeups were performed by the process (only valid for " + "epoll1 right now)", + "How many times was a polling wakeup requested without an active poller " + "(only valid for epoll1 right now)", "How many times was the same polling worker awoken repeatedly before " - "waking up", + "waking up (only valid for epoll1 right now)", "How many times was an eventfd used as the wakeup vector for a polling " - "wakeup", + "wakeup (only valid for epoll1 right now)", "How many times was a condition variable used as the wakeup vector for a " - "polling wakeup", + "polling wakeup (only valid for epoll1 right now)", "How many times could a polling wakeup be satisfied by keeping the waking " - "thread awake?", + "thread awake? (only valid for epoll1 right now)", "Number of times histogram increments went through the slow (binary " "search) path", "Number of write syscalls (or equivalent - eg sendmsg) made by this " diff --git a/src/core/lib/debug/stats_data.yaml b/src/core/lib/debug/stats_data.yaml index 26c8e1b11d2..b43c466d4f0 100644 --- a/src/core/lib/debug/stats_data.yaml +++ b/src/core/lib/debug/stats_data.yaml @@ -35,20 +35,26 @@ doc: How many events are called for each syscall_poll - counter: pollset_kick doc: How many polling wakeups were performed by the process + (only valid for epoll1 right now) - counter: pollset_kicked_without_poller doc: How many times was a polling wakeup requested without an active poller + (only valid for epoll1 right now) - counter: pollset_kicked_again doc: How many times was the same polling worker awoken repeatedly before waking up + (only valid for epoll1 right now) - counter: pollset_kick_wakeup_fd doc: How many times was an eventfd used as the wakeup vector for a polling wakeup + (only valid for epoll1 right now) - counter: pollset_kick_wakeup_cv doc: How many times was a condition variable used as the wakeup vector for a polling wakeup + (only valid for epoll1 right now) - counter: pollset_kick_own_thread doc: How many times could a polling wakeup be satisfied by keeping the waking thread awake? + (only valid for epoll1 right now) # stats system - counter: histogram_slow_lookups doc: Number of times histogram increments went through the slow diff --git a/src/core/lib/iomgr/ev_epoll1_linux.c b/src/core/lib/iomgr/ev_epoll1_linux.c index f7f6cec9ef6..8f661583696 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.c +++ b/src/core/lib/iomgr/ev_epoll1_linux.c @@ -789,7 +789,7 @@ static bool begin_worker(grpc_pollset *pollset, grpc_pollset_worker *worker, } static bool check_neighbourhood_for_available_poller( - pollset_neighbourhood *neighbourhood) { + grpc_exec_ctx *exec_ctx, pollset_neighbourhood *neighbourhood) { GPR_TIMER_BEGIN("check_neighbourhood_for_available_poller", 0); bool found_worker = false; do { @@ -813,6 +813,7 @@ static bool check_neighbourhood_for_available_poller( SET_KICK_STATE(inspect_worker, DESIGNATED_POLLER); if (inspect_worker->initialized_cv) { GPR_TIMER_MARK("signal worker", 0); + GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(exec_ctx); gpr_cv_signal(&inspect_worker->cv); } } else { @@ -891,7 +892,7 @@ static void end_worker(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, g_num_neighbourhoods]; if (gpr_mu_trylock(&neighbourhood->mu)) { found_worker = - check_neighbourhood_for_available_poller(neighbourhood); + check_neighbourhood_for_available_poller(exec_ctx, neighbourhood); gpr_mu_unlock(&neighbourhood->mu); scan_state[i] = true; } else { @@ -904,7 +905,8 @@ static void end_worker(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, &g_neighbourhoods[(poller_neighbourhood_idx + i) % g_num_neighbourhoods]; gpr_mu_lock(&neighbourhood->mu); - found_worker = check_neighbourhood_for_available_poller(neighbourhood); + found_worker = + check_neighbourhood_for_available_poller(exec_ctx, neighbourhood); gpr_mu_unlock(&neighbourhood->mu); } grpc_exec_ctx_flush(exec_ctx);