bcachefs: btree key cache pcpu freedlist
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 17 Jun 2022 05:07:54 +0000 (01:07 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:34 +0000 (17:09 -0400)
commit8f7f566f5774d36196bfa87bc097522fd497d4dc
tree5d60b9478018ad4baf119804cc0d4e980baf365a
parent7bb61e8c0e37fdf5684bc1fa1f6e0b5644cc7f75
bcachefs: btree key cache pcpu freedlist

Originally, the btree key cache code would always allocate new entries
by reusing from the recently-freed list, if that list wasn't empty. But
that behaviour was dropped, for lock contention reasons.

But it seems that entries stranded on the freed list have been
contributing to some of our oom issues, because long running btree
transactions will prevent them from being freed.

This patch re-adds allocating from the freed list, but it also adds
percpu buffers to solve the lock contention issues - and the new percpu
freed lists will improve the evict paths, too.

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