From: Sage Weil Date: Tue, 15 Nov 2016 20:29:24 +0000 (-0500) Subject: os/bluestore: count txcs with unstable io per osr X-Git-Tag: v11.1.0~172^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=503538885fbe3a7579b86e68e2dd2a8988484f92;p=ceph.git os/bluestore: count txcs with unstable io per osr Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index fb2df427ad1..b1f35184a13 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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 bluefs_gift_extents; diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 5b15b7ae157..0b69b5513d1 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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()