diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-31 16:13:05 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:29 -0400 |
commit | b17d3cec14b487924df709dbeffb900f124a2607 (patch) | |
tree | e3a5ce061e8e294d8d0570a7916996cebefb9d8d /fs/bcachefs/util.h | |
parent | 5f417394033a0d8bfb31d02b3becf7381dc13867 (diff) | |
download | linux-b17d3cec14b487924df709dbeffb900f124a2607.tar.gz linux-b17d3cec14b487924df709dbeffb900f124a2607.tar.bz2 linux-b17d3cec14b487924df709dbeffb900f124a2607.zip |
bcachefs: Run btree updates after write out of write_point
In the write path, after the write to the block device(s) complete we
have to punt to process context to do the btree update.
Instead of using the work item embedded in op->cl, this patch switches
to a per write-point work item. This helps with two different issues:
- lock contention: btree updates to the same writepoint will (usually)
be updating the same alloc keys
- context switch overhead: when we're bottlenecked on btree updates,
having a thread (running out of a work item) checking the write point
for completed ops is cheaper than queueing up a new work item and
waking up a kworker.
In an arbitrary benchmark, 4k random writes with fio running inside a
VM, this patch resulted in a 10% improvement in total iops.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r-- | fs/bcachefs/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index fd776fb281b7..085f1c357383 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -352,6 +352,8 @@ static inline void pr_sectors(struct printbuf *out, u64 v) bch2_pr_units(out, v, v << 9); } +void bch2_pr_time_units(struct printbuf *, u64); + #ifdef __KERNEL__ static inline void pr_time(struct printbuf *out, u64 time) { |