bcachefs: Don't normalize to pages in btree cache shrinker
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 4 Apr 2022 00:36:32 +0000 (20:36 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:30 +0000 (17:09 -0400)
commit7c7e071d90ac278e462640570d739dd165d3acd0
treecf32fcc59e4b382afe0776565de25bffebea0021
parent4254f5bf6e3d62ab7108a556d5afc54188e17041
bcachefs: Don't normalize to pages in btree cache shrinker

This behavior dates from the early, early days of bcache, and upon
further delving appears to not make any sense. The shrinker only works
in terms of 'objects' of unknown size; normalizing to pages only had the
effect of changing the batch size, which we could do directly - if we
wanted; we probably don't. Normalizing to pages meant our batch size was
very small, which seems to have been keeping us from doing as much
shrinking as we should be under heavy memory pressure; this patch
appears to alleviate some OOMs we've been seeing.

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