From: Sage Weil Date: Mon, 3 Apr 2017 19:46:45 +0000 (-0400) Subject: os/bluestore: release throttle before commit X-Git-Tag: v12.0.2~153^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5075b27f007a63e097d4c442f3b3160f086f164a;p=ceph.git os/bluestore: release throttle before commit Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index b77f271ba8672..5edb8e347a83f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7497,8 +7497,6 @@ void BlueStore::_txc_committed_kv(TransContext *txc) if (!txc->oncommits.empty()) { finishers[n]->queue(txc->oncommits); } - throttle_ops.put(txc->ops); - throttle_bytes.put(txc->bytes); } void BlueStore::_txc_finish(TransContext *txc) @@ -7786,12 +7784,19 @@ void BlueStore::_kv_sync_thread() } } } - if (num_aios) { - for (auto txc : kv_committing) { - if (txc->had_ios) { - --txc->osr->txc_with_unstable_io; - } + for (auto txc : kv_committing) { + if (txc->had_ios) { + --txc->osr->txc_with_unstable_io; } + + // release throttle *before* we commit. this allows new ops + // to be prepared and enter pipeline while we are waiting on + // the kv commit sync/flush. then hopefully on the next + // iteration there will already be ops awake. otherwise, we + // end up going to sleep, and then wake up when the very first + // transaction is ready for commit. + throttle_ops.put(txc->ops); + throttle_bytes.put(txc->bytes); } PExtentVector bluefs_gift_extents;