diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-11-13 18:36:33 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:49 -0400 |
commit | ebb84d094141eac9ee3e22d95abc9792a1c79eca (patch) | |
tree | 4d5e66377dd2a124a626bad434c46c8d7f8e67b8 /fs/bcachefs/journal_types.h | |
parent | 5db43418d5097b8aca5c725eb301186dee04c70a (diff) | |
download | linux-stable-ebb84d094141eac9ee3e22d95abc9792a1c79eca.tar.gz linux-stable-ebb84d094141eac9ee3e22d95abc9792a1c79eca.tar.bz2 linux-stable-ebb84d094141eac9ee3e22d95abc9792a1c79eca.zip |
bcachefs: Increase journal pipelining
This patch increases the maximum journal buffers in flight from 2 to 4 -
this will be particularly helpful when in the future we stop requiring
flush+fua for every journal write.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
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 | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/bcachefs/journal_types.h b/fs/bcachefs/journal_types.h index 7e328ccc0a8f..ec19f75f8ede 100644 --- a/fs/bcachefs/journal_types.h +++ b/fs/bcachefs/journal_types.h @@ -11,13 +11,13 @@ struct journal_res; -#define JOURNAL_BUF_BITS 1 +#define JOURNAL_BUF_BITS 2 #define JOURNAL_BUF_NR (1U << JOURNAL_BUF_BITS) #define JOURNAL_BUF_MASK (JOURNAL_BUF_NR - 1) /* - * We put two of these in struct journal; we used them for writes to the - * journal that are being staged or in flight. + * We put JOURNAL_BUF_NR of these in struct journal; we used them for writes to + * the journal that are being staged or in flight. */ struct journal_buf { struct jset *data; @@ -85,10 +85,12 @@ union journal_res_state { struct { u64 cur_entry_offset:20, - idx:1, - prev_buf_unwritten:1, - buf0_count:21, - buf1_count:21; + idx:2, + unwritten_idx:2, + buf0_count:10, + buf1_count:10, + buf2_count:10, + buf3_count:10; }; }; @@ -169,7 +171,7 @@ struct journal { * Two journal entries -- one is currently open for new entries, the * other is possibly being written out. */ - struct journal_buf buf[2]; + struct journal_buf buf[JOURNAL_BUF_NR]; spinlock_t lock; |