diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-20 15:35:40 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-20 17:06:20 -0400 |
commit | adfe9357c39e251ffe22ceaa1edb4b7662ed76e6 (patch) | |
tree | 295f094c2e92f9d5ab00b8695710d874d654ee94 /fs/drop_caches.c | |
parent | 6e4d9bd110e293513c3c2a3ff2dfa0a0735699e0 (diff) |
bcachefs: Tweak btree key cache shrinker so it actually frees
Freeing key cache items is a multi stage process; we need to wait for an
SRCU grace period to elapse, and we handle this ourselves - partially to
avoid callback overhead, but primarily so that when allocating we can
first allocate from the freed items waiting for an SRCU grace period.
Previously, the shrinker was counting the items on the 'waiting for SRCU
grace period' lists as items being scanned, but this meant that too many
items waiting for an SRCU grace period could prevent it from doing any
work at all.
After this, we're seeing that items skipped due to the accessed bit are
the main cause of the shrinker not making any progress, and we actually
want the key cache shrinker to run quite aggressively because reclaimed
items will still generally be found (more compactly) in the btree node
cache - so we also tweak the shrinker to not count those against
nr_to_scan.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/drop_caches.c')
0 files changed, 0 insertions, 0 deletions