From 0ededde59fa93b4adc0e182adba922dc0d14dcae Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 15 Nov 2017 11:00:11 -0600 Subject: [PATCH] os/bluestore: store shard, not shard_hint,in OpSequencer Good suggestion from Igor! Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 8 +++----- src/os/bluestore/BlueStore.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 0c9b41497c17..583f8442034f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -8216,9 +8216,8 @@ void BlueStore::_txc_applied_kv(TransContext *txc) void BlueStore::_txc_committed_kv(TransContext *txc) { dout(20) << __func__ << " txc " << txc << dendl; - unsigned n = txc->osr->shard_hint.hash_to_shard(m_finisher_num); logger->tinc(l_bluestore_commit_lat, ceph_clock_now() - txc->start); - finishers[n]->queue(txc->oncommits); + finishers[txc->osr->shard]->queue(txc->oncommits); } void BlueStore::_txc_finish(TransContext *txc) @@ -9013,7 +9012,7 @@ int BlueStore::queue_transactions( } else { osr = new OpSequencer(cct, this); osr->parent = posr; - osr->shard_hint = posr->shard_hint; + osr->shard = posr->shard_hint.hash_to_shard(m_finisher_num); posr->p = osr; dout(10) << __func__ << " new " << osr << " " << *osr << dendl; } @@ -9077,12 +9076,11 @@ int BlueStore::queue_transactions( for (auto c : on_applied_sync) { c->complete(0); } - unsigned n = osr->shard_hint.hash_to_shard(m_finisher_num); for (auto c : on_applied) { // NOTE: these may complete out of order since some may be sync and some // may be async. if (!c->sync_complete(0)) { - finishers[n]->queue(c); + finishers[osr->shard]->queue(c); } } diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 4b2793b60a31..f0c0d0c80810 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1661,7 +1661,7 @@ public: Sequencer *parent; BlueStore *store; - spg_t shard_hint; + size_t shard; uint64_t last_seq = 0; -- 2.47.3