]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add kv_drain_preceding_waiters indicate drain_preceding. 29522/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Wed, 7 Aug 2019 05:30:23 +0000 (13:30 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 8 Aug 2019 00:50:25 +0000 (08:50 +0800)
Condition: (txc->state == TransContext::STATE_PREPARE &&  deferred_aggressive) isn't
correctly for drain_preceding. So represent this event by adding this
parameter.

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

index 94ed213485e7f7cf141f3e5850b0571d72a34904..b94b11d551c407fd72cc283b4b763aaad1f5c762 100644 (file)
@@ -10263,8 +10263,7 @@ void BlueStore::_txc_finish(TransContext *txc)
       dout(20) << __func__ << "  txc " << txc << " " << txc->get_state_name()
               << dendl;
       if (txc->state != TransContext::STATE_DONE) {
-       if (txc->state == TransContext::STATE_PREPARE &&
-         deferred_aggressive) {
+       if (osr->kv_drain_preceding_waiters && txc->state == TransContext::STATE_PREPARE) {
          // for _osr_drain_preceding()
           notify = true;
        }
@@ -10385,7 +10384,7 @@ void BlueStore::_osr_drain_preceding(TransContext *txc)
 {
   OpSequencer *osr = txc->osr.get();
   dout(10) << __func__ << " " << txc << " osr " << osr << dendl;
-  ++deferred_aggressive; // FIXME: maybe osr-local aggressive flag?
+  osr->kv_drain_preceding_waiters++;
   {
     // submit anything pending
     deferred_lock.lock();
@@ -10404,7 +10403,7 @@ void BlueStore::_osr_drain_preceding(TransContext *txc)
     }
   }
   osr->drain_preceding(txc);
-  --deferred_aggressive;
+  osr->kv_drain_preceding_waiters--;
   dout(10) << __func__ << " " << osr << " done" << dendl;
 }
 
index e7668c2e8a55fb925551cc708e0a2a991fd8ce8f..e165e5f0c4b1852c3455ee7ea3181d30614390fe 100644 (file)
@@ -1613,6 +1613,8 @@ public:
 
     std::atomic_int kv_submitted_waiters = {0};
 
+    std::atomic_int kv_drain_preceding_waiters = {0};
+
     std::atomic_bool zombie = {false};    ///< in zombie_osr set (collection going away)
 
     OpSequencer(BlueStore *store, const coll_t& c)