bcachefs: Btree key cache shrinker fix
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 17 Oct 2022 06:08:07 +0000 (02:08 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:44 +0000 (17:09 -0400)
commitb2f83e769f607409753888c95a9b46dc927dc856
treeaa68936d8452e281c3da6920f80cb62579a31090
parentbe75bb7a0e0565c0c409842048567e8d07f28675
bcachefs: Btree key cache shrinker fix

The shrinker assumes freed key cache items are ordered by age, so that
it doesn't have to scan the full list to find items that are old enough
(according to the srcu code) to be freed.

But percpu freelists broke this ordering; this patch fixes this by
ensuring we insert items into the proper position.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_key_cache.c