From 53b1c6f44b1a98ea6def11b74c1fde9710f2a0b9 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 14 Oct 2022 07:02:36 -0400 Subject: 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 --- fs/bcachefs/backpointers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/bcachefs/backpointers.c') diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index 20cd5bf349c4..3978c0b50f20 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -300,7 +300,8 @@ err: int bch2_get_next_backpointer(struct btree_trans *trans, struct bpos bucket, int gen, u64 *bp_offset, - struct bch_backpointer *dst) + struct bch_backpointer *dst, + unsigned iter_flags) { struct bch_fs *c = trans->c; struct bpos bp_pos, bp_end_pos; @@ -921,7 +922,7 @@ static int check_one_backpointer(struct btree_trans *trans, struct printbuf buf = PRINTBUF; int ret; - ret = bch2_get_next_backpointer(trans, bucket, -1, bp_offset, &bp); + ret = bch2_get_next_backpointer(trans, bucket, -1, bp_offset, &bp, 0); if (ret || *bp_offset == U64_MAX) return ret; -- cgit v1.2.3