]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore/BlueStore: Avoid double counting state_kv_queued_lat.
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 17 Jul 2017 22:41:09 +0000 (06:41 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Mon, 17 Jul 2017 22:41:09 +0000 (06:41 +0800)
In fact, if txc in kv_submitting queue it also in kv_committing.
For those txc, we should avoid double counting state_kv_queued_lat.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index 8e68e06bc5f43d65a893c9ab7415412dd18ab0d8..99f1189e5a59eb65e53f7d41a0a17273604b1cda 100644 (file)
@@ -8344,26 +8344,29 @@ void BlueStore::_kv_sync_thread()
        t->set(PREFIX_SUPER, "blobid_max", bl);
        dout(10) << __func__ << " new_blobid_max " << new_blobid_max << dendl;
       }
-      for (auto txc : kv_submitting) {
-       assert(txc->state == TransContext::STATE_KV_QUEUED);
-       txc->log_state_latency(logger, l_bluestore_state_kv_queued_lat);
-       int r = cct->_conf->bluestore_debug_omit_kv_commit ? 0 : db->submit_transaction(txc->t);
-       assert(r == 0);
-       _txc_applied_kv(txc);
-       --txc->osr->kv_committing_serially;
-       txc->state = TransContext::STATE_KV_SUBMITTED;
-       if (txc->osr->kv_submitted_waiters) {
-         std::lock_guard<std::mutex> l(txc->osr->qlock);
-         if (txc->osr->_is_all_kv_submitted()) {
-           txc->osr->qcond.notify_all();
+
+      for (auto txc : kv_committing) {
+       if (txc->state == TransContext::STATE_KV_QUEUED) {
+         txc->log_state_latency(logger, l_bluestore_state_kv_queued_lat);
+         int r = cct->_conf->bluestore_debug_omit_kv_commit ? 0 : db->submit_transaction(txc->t);
+         assert(r == 0);
+         _txc_applied_kv(txc);
+         --txc->osr->kv_committing_serially;
+         txc->state = TransContext::STATE_KV_SUBMITTED;
+         if (txc->osr->kv_submitted_waiters) {
+           std::lock_guard<std::mutex> l(txc->osr->qlock);
+           if (txc->osr->_is_all_kv_submitted()) {
+             txc->osr->qcond.notify_all();
+           }
          }
+
+       } else {
+         assert(txc->state == TransContext::STATE_KV_SUBMITTED);
+         txc->log_state_latency(logger, l_bluestore_state_kv_queued_lat);
        }
-      }
-      for (auto txc : kv_committing) {
        if (txc->had_ios) {
          --txc->osr->txc_with_unstable_io;
        }
-       txc->log_state_latency(logger, l_bluestore_state_kv_queued_lat);
       }
 
       // release throttle *before* we commit.  this allows new ops