From: Jianpeng Ma Date: Wed, 7 Aug 2019 02:30:24 +0000 (+0800) Subject: os/bluestore: reduce unecessary notify. X-Git-Tag: v15.1.0~1903^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f64cc71f5167c8ac76cdc070c7efd53b4ccdecd;p=ceph.git os/bluestore: reduce unecessary notify. In fact, only drain()/drain_preceding() need wakeup. Other case it depend on kv_submitted_waiters. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e9d111ef8553..94ed213485e7 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -10277,15 +10277,18 @@ void BlueStore::_txc_finish(TransContext *txc) osr->q.pop_front(); releasing_txc.push_back(*txc); - notify = true; - } - if (notify) { - osr->qcond.notify_all(); } + if (osr->q.empty()) { dout(20) << __func__ << " osr " << osr << " q now empty" << dendl; empty = true; } + + // only drain()/drain_preceding() need wakeup, + // other cases use kv_submitted_waiters + if (notify || empty) { + osr->qcond.notify_all(); + } } while (!releasing_txc.empty()) { // release to allocator only after all preceding txc's have also