From: Jianpeng Ma Date: Wed, 7 Aug 2019 05:30:23 +0000 (+0800) Subject: os/bluestore: add kv_drain_preceding_waiters indicate drain_preceding. X-Git-Tag: v15.1.0~1903^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ff71ad472e94e14f392c618b6eb5e8608afec94f;p=ceph.git os/bluestore: add kv_drain_preceding_waiters indicate drain_preceding. 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 94ed213485e7..b94b11d551c4 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; } diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index e7668c2e8a55..e165e5f0c4b1 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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)