summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/opts.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-11-02 18:57:19 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 11:47:41 -0500
commit09caeabe1a5daa3b667b797c401d43206d583f23 (patch)
tree38285367be9d45f8ecbbe12f233744548d2ec455 /fs/bcachefs/opts.h
parentb05c0e9370bec71c62df690250f451e58e8ed2a4 (diff)
downloadlinux-09caeabe1a5daa3b667b797c401d43206d583f23.tar.gz
linux-09caeabe1a5daa3b667b797c401d43206d583f23.tar.bz2
linux-09caeabe1a5daa3b667b797c401d43206d583f23.zip
bcachefs: btree write buffer now slurps keys from journal
Previosuly, the transaction commit path would have to add keys to the btree write buffer as a separate operation, requiring additional global synchronization. This patch introduces a new journal entry type, which indicates that the keys need to be copied into the btree write buffer prior to being written out. We switch the journal entry type back to JSET_ENTRY_btree_keys prior to write, so this is not an on disk format change. Flushing the btree write buffer may require pulling keys out of journal entries yet to be written, and quiescing outstanding journal reservations; we previously added journal->buf_lock for synchronization with the journal write path. We also can't put strict bounds on the number of keys in the journal destined for the write buffer, which means we might overflow the size of the preallocated buffer and have to reallocate - this introduces a potentially fatal memory allocation failure. This is something we'll have to watch for, if it becomes an issue in practice we can do additional mitigation. The transaction commit path no longer has to explicitly check if the write buffer is full and wait on flushing; this is another performance optimization. Instead, when the btree write buffer is close to full we change the journal watermark, so that only reservations for journal reclaim are allowed. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.h')
-rw-r--r--fs/bcachefs/opts.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h
index 7f9e3001bf55..cf69b92cbd03 100644
--- a/fs/bcachefs/opts.h
+++ b/fs/bcachefs/opts.h
@@ -233,11 +233,6 @@ enum fsck_err_opts {
OPT_BOOL(), \
BCH2_NO_SB_OPT, true, \
NULL, "Stash pointer to in memory btree node in btree ptr")\
- x(btree_write_buffer_size, u32, \
- OPT_FS|OPT_MOUNT, \
- OPT_UINT(16, (1U << 20) - 1), \
- BCH2_NO_SB_OPT, 1U << 13, \
- NULL, "Number of btree write buffer entries") \
x(gc_reserve_percent, u8, \
OPT_FS|OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME, \
OPT_UINT(5, 21), \