summaryrefslogtreecommitdiff
path: root/fs/bcachefs/move.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-10-14 14:02:36 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:51 +0300
commit53b1c6f44b1a98ea6def11b74c1fde9710f2a0b9 (patch)
treec159854a027182913261e2e4bea9aff9ae34e401 /fs/bcachefs/move.c
parentb32f9a577b8d532d31ee7d71e58d1ec512a25a9a (diff)
downloadlinux-53b1c6f44b1a98ea6def11b74c1fde9710f2a0b9.tar.xz
bcachefs: Don't use key cache during fsck
The btree key cache mainly helps with lock contention, at the cost of additional memory overhead. During some fsck passes the memory overhead really matters, but fsck is single threaded so lock contention is an issue - so skipping the key cache during fsck will help with performance. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/move.c')
-rw-r--r--fs/bcachefs/move.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
index 690c3128c5e1..8eb4978cc043 100644
--- a/fs/bcachefs/move.c
+++ b/fs/bcachefs/move.c
@@ -608,7 +608,8 @@ failed_to_evacuate:
bch2_trans_begin(trans);
ret = bch2_get_next_backpointer(trans, bucket, gen,
- &bp_offset, &bp);
+ &bp_offset, &bp,
+ BTREE_ITER_CACHED);
if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
continue;
if (ret)
@@ -681,7 +682,8 @@ int __bch2_evacuate_bucket(struct moving_context *ctxt,
bch2_trans_begin(&trans);
ret = bch2_get_next_backpointer(&trans, bucket, gen,
- &bp_offset, &bp);
+ &bp_offset, &bp,
+ BTREE_ITER_CACHED);
if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
continue;
if (ret)