From: Samuel Just Date: Tue, 10 Feb 2015 01:41:19 +0000 (-0800) Subject: ShardedThreadPool: make wait timeout on empty queue configurable X-Git-Tag: v0.93~63^2~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7002f934e6664daa995ca0629c0ea3bae1c6bddf;p=ceph.git ShardedThreadPool: make wait timeout on empty queue configurable Fixes: 10818 Backport: giant Signed-off-by: Samuel Just --- diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index 9d38f08e5388c..00666faca3343 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -306,8 +306,12 @@ void ShardedThreadPool::shardedthreadpool_worker(uint32_t thread_index) ++num_paused; wait_cond.Signal(); while(pause_threads.read()) { - cct->get_heartbeat_map()->reset_timeout(hb, 4, 0); - shardedpool_cond.WaitInterval(cct, shardedpool_lock, utime_t(2, 0)); + cct->get_heartbeat_map()->reset_timeout( + hb, + wq->timeout_interval, wq->suicide_interval); + shardedpool_cond.WaitInterval(cct, shardedpool_lock, + utime_t( + cct->_conf->threadpool_empty_queue_max_wait, 0)); } --num_paused; shardedpool_lock.Unlock(); @@ -318,14 +322,21 @@ void ShardedThreadPool::shardedthreadpool_worker(uint32_t thread_index) ++num_drained; wait_cond.Signal(); while (drain_threads.read()) { - cct->get_heartbeat_map()->reset_timeout(hb, 4, 0); - shardedpool_cond.WaitInterval(cct, shardedpool_lock, utime_t(2, 0)); + cct->get_heartbeat_map()->reset_timeout( + hb, + wq->timeout_interval, wq->suicide_interval); + shardedpool_cond.WaitInterval(cct, shardedpool_lock, + utime_t( + cct->_conf->threadpool_empty_queue_max_wait, 0)); } --num_drained; } shardedpool_lock.Unlock(); } + cct->get_heartbeat_map()->reset_timeout( + hb, + wq->timeout_interval, wq->suicide_interval); wq->_process(thread_index, hb); }