From: Max Kellermann Date: Mon, 30 Sep 2024 09:10:16 +0000 (+0200) Subject: msg/DispatchQueue: wake up only one dispatch thread X-Git-Tag: testing/wip-rishabh-testing-20250207.203802~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=23fd2cc44864ac793b09d8e60b30cfffe22f0116;p=ceph-ci.git msg/DispatchQueue: wake up only one dispatch thread When adding one message, only one thread needs to be woken up. Waking up all is a more expensive operation and leads to unnecessary lock contention and context switches. Signed-off-by: Max Kellermann --- diff --git a/src/msg/DispatchQueue.cc b/src/msg/DispatchQueue.cc index b8ed6f7efe8..4694bdff587 100644 --- a/src/msg/DispatchQueue.cc +++ b/src/msg/DispatchQueue.cc @@ -93,7 +93,7 @@ void DispatchQueue::enqueue(const ref_t& m, int priority, uint64_t id) } else { mqueue.enqueue(id, priority, m->get_cost(), QueueItem(m)); } - cond.notify_all(); + cond.notify_one(); } void DispatchQueue::local_delivery(const ref_t& m, int priority)