]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
bcachefs: Add a time_stat for blocked on key cache flush
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 10 Aug 2024 19:48:18 +0000 (15:48 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 14 Aug 2024 03:00:50 +0000 (23:00 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_trans_commit.c

index eedf2d6045e73fc54571d20b6efb786779bcb80d..0c7086e00d18f55cb2cc19e6b598f1782a72d255 100644 (file)
@@ -447,6 +447,7 @@ BCH_DEBUG_PARAMS_DEBUG()
        x(blocked_journal_low_on_space)         \
        x(blocked_journal_low_on_pin)           \
        x(blocked_journal_max_in_flight)        \
+       x(blocked_key_cache_flush)              \
        x(blocked_allocate)                     \
        x(blocked_allocate_open_bucket)         \
        x(blocked_write_buffer_full)            \
index f567bfb828508ac8c34f0f79e11ac8f7d5bed98b..ac0c92683aad4b5263c792ffdb17f8bdec2d3b7a 100644 (file)
@@ -973,9 +973,13 @@ int bch2_trans_commit_error(struct btree_trans *trans, unsigned flags,
                bch2_trans_unlock(trans);
 
                trace_and_count(c, trans_blocked_journal_reclaim, trans, trace_ip);
+               track_event_change(&c->times[BCH_TIME_blocked_key_cache_flush], true);
 
                wait_event_freezable(c->journal.reclaim_wait,
                                     (ret = journal_reclaim_wait_done(c)));
+
+               track_event_change(&c->times[BCH_TIME_blocked_key_cache_flush], false);
+
                if (ret < 0)
                        break;