]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: count txcs with unstable io per osr
authorSage Weil <sage@redhat.com>
Tue, 15 Nov 2016 20:29:24 +0000 (15:29 -0500)
committerSage Weil <sage@redhat.com>
Fri, 18 Nov 2016 14:58:16 +0000 (08:58 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index fb2df427ad14d4f15d1491b9bedf9096b6881c17..b1f35184a1304b21b02ca07e9c263e48bc9ec375 100644 (file)
@@ -6198,6 +6198,7 @@ void BlueStore::_txc_state_proc(TransContext *txc)
       txc->log_state_latency(logger, l_bluestore_state_prepare_lat);
       if (txc->ioc.has_pending_aios()) {
        txc->state = TransContext::STATE_AIO_WAIT;
+       txc->had_ios = true;
        _txc_aio_submit(txc);
        return;
       }
@@ -6210,6 +6211,9 @@ void BlueStore::_txc_state_proc(TransContext *txc)
 
     case TransContext::STATE_IO_DONE:
       //assert(txc->osr->qlock.is_locked());  // see _txc_finish_io
+      if (txc->had_ios) {
+       ++txc->osr->txc_with_unstable_io;
+      }
       txc->log_state_latency(logger, l_bluestore_state_io_done_lat);
       txc->state = TransContext::STATE_KV_QUEUED;
       for (auto& sb : txc->shared_blobs_written) {
@@ -6648,6 +6652,9 @@ void BlueStore::_kv_sync_thread()
       }
       for (auto txc : kv_committing) {
        _txc_release_alloc(txc);
+       if (txc->had_ios) {
+         --txc->osr->txc_with_unstable_io;
+       }
       }
 
       vector<bluestore_pextent_t> bluefs_gift_extents;
index 5b15b7ae157ad9a7b05261cb4cac44e1cb264d3d..0b69b5513d102bc4029c804f837de14a7791ab56 100644 (file)
@@ -1281,6 +1281,7 @@ public:
 
 
     IOContext ioc;
+    bool had_ios = false;  ///< true if we submitted IOs before our kv txn
 
     CollectionRef first_collection;  ///< first referenced collection
 
@@ -1342,6 +1343,8 @@ public:
 
     uint64_t last_seq = 0;
 
+    std::atomic_int txc_with_unstable_io = {0};  ///< num txcs with unstable io
+
     std::atomic_int kv_committing_serially = {0};
 
     OpSequencer()