diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-06 05:27:27 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-06 19:50:26 +0200 |
commit | 6088234ce83acec4aaf56ecc0e9525bac18b4295 (patch) | |
tree | b72e80255b37eaba6b7574b56f5391277b5635cd /fs/bcachefs/util.h | |
parent | bcachefs: Disable errors=panic for BCH_IOCTL_FSCK_OFFLINE (diff) | |
download | linux-6088234ce83acec4aaf56ecc0e9525bac18b4295.tar.xz linux-6088234ce83acec4aaf56ecc0e9525bac18b4295.zip |
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>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r-- | fs/bcachefs/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index de639e8a3ab5..5cf885b09986 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -788,6 +788,14 @@ static inline int copy_from_user_errcode(void *to, const void __user *from, unsi #endif +static inline void mod_bit(long nr, volatile unsigned long *addr, bool v) +{ + if (v) + set_bit(nr, addr); + else + clear_bit(nr, addr); +} + static inline void __set_bit_le64(size_t bit, __le64 *addr) { addr[bit / 64] |= cpu_to_le64(BIT_ULL(bit % 64)); |