Hello Dan Burkert, Todd Lipcon, I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/9021 to review the following change. Change subject: KUDU-1913: LIFO wake up ordering for threadpool worker threads ...................................................................... KUDU-1913: LIFO wake up ordering for threadpool worker threads This patch changes the wake-up ordering for idle pool worker threads to be LIFO. Previously all worker threads idled on a single ConditionVariable which, by virtue of using pthread_cond_t under the hood, was FIFO ordered. In the abstract, FIFO ordering ensures a fair distribution of work amongst a set of threads, but that's totally undesirable in a thread pool where the goal is to get work done as quickly and with as few threads as possible. For example, a fast stream of cheap tasks (e.g. RPCs) should be serviceable via a single thread or something close to that. The new unit test was looped 1000 times in TSAN mode with 8 stress threads to shake out any flakes. Additionally, I ran through a variation of Todd's test from a past code review [1]. I spun up three tservers, two of which had failure detection disabled so that the third would get all of the leader replicas. I created 240 tablets and looked at the size of the Raft thread pool on that tserver. The steady state thread count was mildly lower at first (4 vs. 8) but was much lower (4 vs. 30) after a SIGSTOP+SIGCONT cycle. 1. https://gerrit.cloudera.org/c/7331 Change-Id: I8036bf0d15f9ffcb3fa76579e3bfe0a340d38320 --- M src/kudu/util/test_util.cc M src/kudu/util/test_util.h M src/kudu/util/threadpool-test.cc M src/kudu/util/threadpool.cc M src/kudu/util/threadpool.h 5 files changed, 114 insertions(+), 15 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/21/9021/1 -- To view, visit http://gerrit.cloudera.org:8080/9021 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8036bf0d15f9ffcb3fa76579e3bfe0a340d38320 Gerrit-Change-Number: 9021 Gerrit-PatchSet: 1 Gerrit-Owner: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Dan Burkert <danburk...@apache.org> Gerrit-Reviewer: Todd Lipcon <t...@apache.org>