]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: store shard, not shard_hint,in OpSequencer
authorSage Weil <sage@redhat.com>
Wed, 15 Nov 2017 17:00:11 +0000 (11:00 -0600)
committerSage Weil <sage@redhat.com>
Mon, 11 Dec 2017 21:05:38 +0000 (15:05 -0600)
Good suggestion from Igor!

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 0c9b41497c17ca10708a1bd0471559f090572fc0..583f8442034f3796953c63655c8f5007ee046327 100644 (file)
@@ -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);
     }
   }
 
index 4b2793b60a3153e4503b193b12c50e43e32f7f41..f0c0d0c80810811732064fa1c2427b867629454f 100644 (file)
@@ -1661,7 +1661,7 @@ public:
     Sequencer *parent;
     BlueStore *store;
 
-    spg_t shard_hint;
+    size_t shard;
 
     uint64_t last_seq = 0;