bcachefs: JOURNAL_SPACE_LOW
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 6 Apr 2024 03:27:27 +0000 (23:27 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 6 Apr 2024 17:50:26 +0000 (13:50 -0400)
commit6088234ce83acec4aaf56ecc0e9525bac18b4295
treeb72e80255b37eaba6b7574b56f5391277b5635cd
parent05801b6526156aefe55c0440fab877109c9a89c5
bcachefs: JOURNAL_SPACE_LOW

"bcachefs; Fix deadlock in bch2_btree_update_start()" was a significant
performance regression (nearly 50%) on multithreaded random writes with
fio.

The reason is that the journal watermark checks multiple things,
including the state of the btree write buffer, and on multithreaded
update heavy workloads we're bottleneked on write buffer flushing - we
don't want kicknig off btree updates to depend on the state of the write
buffer.

This isn't strictly correct; the interior btree update path does do
write buffer updates, but it's a tiny fraction of total accounting
updates and we're more concerned with space in the journal itself.

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