bcachefs: Btree key cache optimization
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 4 Jan 2023 09:34:16 +0000 (04:34 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:24 +0000 (17:09 -0400)
commit8322a9376eb21c47829128684fd900016a0e0169
treee3c6bf103176d359a67aa03c3ac5171697e63ff9
parent702a4ef07774fbc565f3e567073d2f83f9602667
bcachefs: Btree key cache optimization

This helps with lock contention in the journalling code: instead of
updating our journal pin on every write, only get a journal pin if we
don't have one.

This means we can avoid hammering on journal locks nearly so much, at
the cost of carrying around a journal pin for an older entry than the
one we actually need. To handle that, if needed we update our journal
pin to the correct one when flushed by journal reclaim.

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