From: Sage Weil Date: Wed, 15 Nov 2017 17:00:11 +0000 (-0600) Subject: os/bluestore: store shard, not shard_hint,in OpSequencer X-Git-Tag: v13.0.2~743^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ededde59fa93b4adc0e182adba922dc0d14dcae;p=ceph.git os/bluestore: store shard, not shard_hint,in OpSequencer Good suggestion from Igor! Signed-off-by: Sage Weil --- 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;