bcachefs: Make bch2_btree_cache_scan() try harder
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 3 Mar 2022 16:04:01 +0000 (11:04 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:26 +0000 (17:09 -0400)
commit05a49d22750ec4977b52c9da09039a931c0f2644
treed0584a2853c443ae9370b2a8a3e3fbf02ea9806c
parente0c014e7e4ccd4d865b637721e3e580505c29b07
bcachefs: Make bch2_btree_cache_scan() try harder

Previously, when bch2_btree_cache_scan() attempted to reclaim a node but
failed (because trylock failed, because it was dirty, etc.), it would
count that against the number of nodes it was scanning and attempting to
free. This patch changes that behaviour, so that now we only count nodes
that we then don't free if they have the accessed bit (which we also
clear).

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_cache.c