From 0cb01c4f4bfdcbd7a5531fe4ed7e732dfb4792ee Mon Sep 17 00:00:00 2001 From: Pan Liu Date: Wed, 9 Nov 2016 17:45:27 +0800 Subject: [PATCH] BlueStore: speedup the performance of multi-replication flow by switching the callback order in bluestore. In Bluestore ack callback and commit callback are queued one by one in the function "BlueStore;:_txc_finish_kv". Therefore, just only one callback is needed to call, in order to improve performance. We do this by switching the callback order in bluestore, and the callback work can be done in sub_op_modify_commit and doesn't need to do it again in sub_op_modify_applied. Signed-off-by: Pan Liu --- src/os/bluestore/BlueStore.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 00a3e879a3cf3..aea01d5eef8d6 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6511,14 +6511,14 @@ void BlueStore::_txc_finish_kv(TransContext *txc) txc->onreadable_sync = NULL; } unsigned n = txc->osr->parent->shard_hint.hash_to_shard(m_finisher_num); - if (txc->onreadable) { - finishers[n]->queue(txc->onreadable); - txc->onreadable = NULL; - } if (txc->oncommit) { finishers[n]->queue(txc->oncommit); txc->oncommit = NULL; } + if (txc->onreadable) { + finishers[n]->queue(txc->onreadable); + txc->onreadable = NULL; + } while (!txc->oncommits.empty()) { auto f = txc->oncommits.front(); finishers[n]->queue(f); -- 2.39.5