diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-31 14:26:15 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-10 15:34:08 -0400 |
commit | 916abefd437be89383e720f19a43f727f045a468 (patch) | |
tree | 1855fe5f28afd255f1c99f7ed80991e16d05281b /fs/bcachefs/journal_types.h | |
parent | 38789c25087471121cfa42333bfb249eae539682 (diff) | |
download | linux-stable-916abefd437be89383e720f19a43f727f045a468.tar.gz linux-stable-916abefd437be89383e720f19a43f727f045a468.tar.bz2 linux-stable-916abefd437be89383e720f19a43f727f045a468.zip |
bcachefs: better journal pipelining
Recently a severe performance regression was discovered, which bisected
to
a6548c8b5eb5 bcachefs: Avoid flushing the journal in the discard path
It turns out the old behaviour, which issued excessive journal flushes,
worked around a performance issue where queueing delays would cause the
journal to not be able to write quickly enough and stall.
The journal flushes masked the issue because they periodically flushed
the device write cache, reducing write latency for non flushes.
This patch reworks the journalling code to allow more than one
(non-flush) write to be in flight at a time. With this patch, doing 4k
random writes and an iodepth of 128, we are now able to hit 560k iops to
a Samsung 970 EVO Plus - previously, we were stuck in the ~200k range.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_types.h')
-rw-r--r-- | fs/bcachefs/journal_types.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/bcachefs/journal_types.h b/fs/bcachefs/journal_types.h index d75fbd3b1d34..3696aac3ccb7 100644 --- a/fs/bcachefs/journal_types.h +++ b/fs/bcachefs/journal_types.h @@ -34,10 +34,13 @@ struct journal_buf { unsigned disk_sectors; /* maximum size entry could have been, if buf_size was bigger */ unsigned u64s_reserved; - bool noflush; /* write has already been kicked off, and was noflush */ - bool must_flush; /* something wants a flush */ - bool separate_flush; - bool need_flush_to_write_buffer; + bool noflush:1; /* write has already been kicked off, and was noflush */ + bool must_flush:1; /* something wants a flush */ + bool separate_flush:1; + bool need_flush_to_write_buffer:1; + bool write_started:1; + bool write_allocated:1; + bool write_done:1; u8 idx; }; |