]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: Handle oncommits and wait for future work items from mClock queue 47490/head
authorSridhar Seshasayee <sseshasa@redhat.com>
Thu, 21 Jul 2022 16:01:55 +0000 (21:31 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 8 Aug 2022 04:50:17 +0000 (10:20 +0530)
commit2207f8d7318ba219f071fa1fa2f1cb553b7e06c2
treece8adfe18eb7f8de9f20eb00b7c744da612f04f5
parentccf2c7abe4dc5f7b79ac61fb34e8b7305a947587
osd: Handle oncommits and wait for future work items from mClock queue

When a worker thread with the smallest thread index waits for future work
items from the mClock queue, oncommit callbacks are called. But after the
callback, the thread has to continue waiting instead of returning back to
the ShardedThreadPool::shardedthreadpool_worker() loop. Returning results
in the threads with the smallest index across all shards to busy loop
causing very high CPU utilization.

The fix involves reacquiring the shard_lock and waiting on sdata_cond
until notified or until time period lapses. After this, the smallest
thread index repopulates the oncommit queue from the context_queue
if there were any additions.

Fixes: https://tracker.ceph.com/issues/56530
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
(cherry picked from commit 180a5a7bffd4d96c472cc39447717958dd51bbd9)
src/osd/OSD.cc