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 <jianpeng.ma@intel.com>
This commit is contained in:
Jianpeng Ma 2019-08-07 13:30:23 +08:00
parent 3f64cc71f5
commit ff71ad472e
2 changed files with 5 additions and 4 deletions

View 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;
}

View 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)