]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg/async: Implement smarter worker thread selection 9633/head
authorPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Fri, 26 Feb 2016 12:54:20 +0000 (13:54 +0100)
committerSage Weil <sage@redhat.com>
Tue, 7 Jun 2016 15:01:49 +0000 (11:01 -0400)
commitcb9e9e1c322cb7fb2150b15b17bde4371fd1e703
tree69414a4e291c280a3bd47e09071188dc627120dc
parent578ac8aacfdd0ecfecb3ae3ebeb8a0b3ff53b67d
msg/async: Implement smarter worker thread selection

This changeset makes AsyncMessenger a bit smarter when it comes
to assigning worker threads to AsyncConnections. Each time a worker
is assigned, its reference count is increased. Next time when Async
Messenger needs to assign another worker to new AsyncConnection, it
picks the one with the lowest reference count. If it cannot find an
idle one, and number of currently instantiated workers is less than
specified with "ms async op max threads", the new worker is created
and returned.
Once AsyncConnection goes away, the reference count on assigned
worker is decreased.
This does not prevent, but greatly reduces chances of having a single
async worker thread doing most (or even all) of the ops, and also
removes the need to manually tune the "ms async op threads" option.

Signed-off-by: Piotr Dałek <git@predictor.org.pl>
(cherry picked from commit 3e80f8d74a535e14d4092b27ea5417bacff8394e)
src/common/config_opts.h
src/msg/async/AsyncConnection.cc
src/msg/async/AsyncConnection.h
src/msg/async/AsyncMessenger.cc
src/msg/async/AsyncMessenger.h