From 5075b27f007a63e097d4c442f3b3160f086f164a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 3 Apr 2017 15:46:45 -0400 Subject: [PATCH] os/bluestore: release throttle before commit Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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; -- 2.39.5