summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_key_cache_types.h
AgeCommit message (Collapse)AuthorFilesLines
2024-05-09bcachefs: Btree key cache instrumentationKent Overstreet1-0/+8
It turns out the btree key cache shrinker wasn't actually reclaiming anything, prior to the previous patch. This adds instrumentation so that if we have further issues we can see what's going on. Specifically, sysfs internal/btree_key_cache is greatly expanded with new counters, and the SRCU sequence numbers of the first 10 entries on each pending freelist, and we also add trigger_btree_key_cache_shrink for testing without having to prune all the system caches. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-14bcachefs: Run btree key cache shrinker less aggressivelyKent Overstreet1-0/+4
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-14bcachefs: Split out btree_key_cache_types.hKent Overstreet1-0/+30
More consistent organization. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>