summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-07-21 22:57:20 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:08 -0400
commitc6923995296e5f06a47aa36e684ef0eccd17adea (patch)
treed2d2dd9ad4fc9846b79b56544c7714e397f79579 /fs/bcachefs/journal_io.c
parent8bb4dff72d07f4f46e5627870a9614c4cee5a1bb (diff)
downloadlwn-c6923995296e5f06a47aa36e684ef0eccd17adea.tar.gz
lwn-c6923995296e5f06a47aa36e684ef0eccd17adea.zip
bcachefs: don't call bch2_bucket_seq_cleanup from journal_buf_switch
journal_buf_switch is called from the foreground when getting a journal reservation and thus is somewhat latency sensitive; bch2_bucket_seq_cleanup has to run infrequently but is a bit expensive when it does run. Call it from the journal write path instead, and punt the journal write to worqueue context. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_io.c')
-rw-r--r--fs/bcachefs/journal_io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index 320f4f2933c1..d479d946eea7 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -1384,6 +1384,8 @@ no_io:
extent_for_each_ptr(bkey_i_to_s_extent(&j->key), ptr)
ptr->offset += sectors;
+ bch2_bucket_seq_cleanup(c);
+
continue_at(cl, journal_write_done, system_highpri_wq);
return;
err: