]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: reduce unecessary notify.
authorJianpeng Ma <jianpeng.ma@intel.com>
Wed, 7 Aug 2019 02:30:24 +0000 (10:30 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 8 Aug 2019 00:50:14 +0000 (08:50 +0800)
In fact, only drain()/drain_preceding() need wakeup.
Other case it depend on kv_submitted_waiters.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index e9d111ef8553cd9248af78b216146a5daf24b48b..94ed213485e7f7cf141f3e5850b0571d72a34904 100644 (file)
@@ -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