Commit Graph

2 Commits

Author SHA1 Message Date
Kent Overstreet c65c13f0ea bcachefs: Run btree key cache shrinker less aggressively
The btree key cache maintains lists of items that have been freed, but
can't yet be reclaimed because a bch2_trans_relock() call might find
them - we're waiting for SRCU readers to release.

Previously, we wouldn't count these items against the number we're
attempting to scan for, which would mean we'd evict more live key cache
entries - doing quite a bit of potentially unecessary work.

With recent work to make sure we don't hold SRCU locks for too long, it
should be safe to count all the items on the freelists against number to
scan - even if we can't reclaim them yet, we will be able to soon.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-13 21:45:01 -05:00
Kent Overstreet 1bd5bcc9f5 bcachefs: Split out btree_key_cache_types.h
More consistent organization.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-13 21:44:14 -05:00