bcachefs: btree key cache locking improvements
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 25 Mar 2021 03:37:33 +0000 (23:37 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:57 +0000 (17:08 -0400)
commit331194a230f5fb266a64880e905c0364aa834964
tree6a838a4d76a001463671e54da58b9a1f1660f066
parent2649b514b6cad329da0a4c8cafbd48c32bbc1b9d
bcachefs: btree key cache locking improvements

The btree key cache mutex was becoming a significant bottleneck - it was
mainly used to protect the lists of dirty, clean and freed cached keys.

This patch eliminates the dirty and clean lists - instead, when we need
to scan for keys to drop from the cache we iterate over the rhashtable,
and thus we're able to remove most uses of that lock.

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