linux/fs/bcachefs
Kent Overstreet 920e69bc3d bcachefs: Btree write buffer
This adds a new method of doing btree updates - a straight write buffer,
implemented as a flat fixed size array.

This is only useful when we don't need to read from the btree in order
to do the update, and when reading is infrequent - perfect for the LRU
btree.

This will make LRU btree updates fast enough that we'll be able to use
it for persistently indexing buckets by fragmentation, which will be a
massive boost to copygc performance.

Changes:
 - A new btree_insert_type enum, for btree_insert_entries. Specifies
   btree, btree key cache, or btree write buffer.

 - bch2_trans_update_buffered(): updates via the btree write buffer
   don't need a btree path, so we need a new update path.

 - Transaction commit path changes:
   The update to the btree write buffer both mutates global, and can
   fail if there isn't currently room. Therefore we do all write buffer
   updates in the transaction all at once, and also if it fails we have
   to revert filesystem usage counter changes.

   If there isn't room we flush the write buffer in the transaction
   commit error path and retry.

 - A new persistent option, for specifying the number of entries in the
   write buffer.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:09:50 -04:00
..
acl.c bcachefs: Assorted checkpatch fixes 2023-10-22 17:09:44 -04:00
acl.h bcachefs: Plumb through subvolume id 2023-10-22 17:09:12 -04:00
alloc_background.c bcachefs: Go RW before check_alloc_info() 2023-10-22 17:09:50 -04:00
alloc_background.h bcachefs: Better inlining for bch2_alloc_to_v4_mut 2023-10-22 17:09:49 -04:00
alloc_foreground.c bcachefs: Go RW before check_alloc_info() 2023-10-22 17:09:50 -04:00
alloc_foreground.h bcachefs: Better inlining in core write path 2023-10-22 17:09:49 -04:00
alloc_types.h bcachefs: bucket_alloc_state 2023-10-22 17:09:42 -04:00
bcachefs_format.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
bcachefs_ioctl.h bcachefs: Convert to __packed and __aligned 2023-10-22 17:09:45 -04:00
bcachefs.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
bkey_buf.h bcachefs: Move bkey bkey_unpack_key() to bkey.h 2023-10-22 17:09:45 -04:00
bkey_cmp.h bcachefs: bch2_bkey_cmp_packed_inlined() 2023-10-22 17:09:45 -04:00
bkey_methods.c bcachefs: More errcode cleanup 2023-10-22 17:09:48 -04:00
bkey_methods.h bcachefs: New bpos_cmp(), bkey_cmp() replacements 2023-10-22 17:09:47 -04:00
bkey_sort.c bcachefs: Btree split improvement 2023-10-22 17:09:46 -04:00
bkey_sort.h bcachefs: Kill bch2_sort_repack_merge() 2023-10-22 17:09:19 -04:00
bkey.c bcachefs: Add some unlikely() annotations 2023-10-22 17:09:48 -04:00
bkey.h bcachefs: bkey_min(), bkey_max() 2023-10-22 17:09:48 -04:00
bset.c bcachefs: New bpos_cmp(), bkey_cmp() replacements 2023-10-22 17:09:47 -04:00
bset.h bcachefs: Btree split improvement 2023-10-22 17:09:46 -04:00
btree_cache.c bcachefs: Use six_lock_ip() 2023-10-22 17:09:50 -04:00
btree_cache.h bcachefs: Move bkey bkey_unpack_key() to bkey.h 2023-10-22 17:09:45 -04:00
btree_gc.c bcachefs: Better inlining for bch2_alloc_to_v4_mut 2023-10-22 17:09:49 -04:00
btree_gc.h bcachefs: Fix a null ptr deref 2023-10-22 17:09:31 -04:00
btree_io.c bcachefs: Improve btree node read error path 2023-10-22 17:09:50 -04:00
btree_io.h bcachefs: Plumb saw_error through to btree_err() 2023-10-22 17:09:48 -04:00
btree_iter.c bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_iter.h bcachefs: Use for_each_btree_key_upto() more consistently 2023-10-22 17:09:50 -04:00
btree_key_cache.c bcachefs: Kill trans->flags 2023-10-22 17:09:50 -04:00
btree_key_cache.h bcachefs: Kill trans->flags 2023-10-22 17:09:50 -04:00
btree_locking.c bcachefs: trans->notrace_relock_fail 2023-10-22 17:09:50 -04:00
btree_locking.h bcachefs: Use six_lock_ip() 2023-10-22 17:09:50 -04:00
btree_types.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_update_interior.c bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
btree_update_interior.h bcachefs: Improved btree write statistics 2023-10-22 17:09:45 -04:00
btree_update_leaf.c bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_update.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_write_buffer_types.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_write_buffer.c bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_write_buffer.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
buckets_types.h bcachefs: Fold bucket_state in to BCH_DATA_TYPES() 2023-10-22 17:09:30 -04:00
buckets_waiting_for_journal_types.h bcachefs: New data structure for buckets waiting on journal commit 2023-10-22 17:09:22 -04:00
buckets_waiting_for_journal.c bcachefs: New data structure for buckets waiting on journal commit 2023-10-22 17:09:22 -04:00
buckets_waiting_for_journal.h bcachefs: New data structure for buckets waiting on journal commit 2023-10-22 17:09:22 -04:00
buckets.c bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
buckets.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
chardev.c bcachefs: Fix BCH_IOCTL_DISK_SET_STATE 2023-10-22 17:09:47 -04:00
chardev.h
checksum.c bcachefs: Inlining improvements 2023-10-22 17:09:45 -04:00
checksum.h bcachefs: Inlining improvements 2023-10-22 17:09:45 -04:00
clock_types.h bcachefs: Persist 64 bit io clocks 2023-10-22 17:08:52 -04:00
clock.c bcachefs: Printbuf rework 2023-10-22 17:09:33 -04:00
clock.h
compress.c bcachefs: __bio_compress() fix up. 2023-10-22 17:09:44 -04:00
compress.h
counters.c bcachefs: Fix sb_field_counters formatting 2023-10-22 17:09:40 -04:00
counters.h bcachefs: Add persistent counters 2023-10-22 17:09:32 -04:00
darray.h bcachefs: darrays 2023-10-22 17:09:28 -04:00
data_update.c bcachefs: Fix rereplicate when we already have a cached pointer 2023-10-22 17:09:49 -04:00
data_update.h bcachefs: Handle dropping pointers in data_update path 2023-10-22 17:09:42 -04:00
debug.c bcachefs: debug: Fix some locking bugs 2023-10-22 17:09:49 -04:00
debug.h bcachefs: Update bch2_btree_verify() 2023-10-22 17:09:01 -04:00
dirent.c bcachefs: More errcode cleanup 2023-10-22 17:09:48 -04:00
dirent.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
disk_groups.c bcachefs: More errcode cleanup 2023-10-22 17:09:48 -04:00
disk_groups.h bcachefs: Fix adding a device with a label 2023-10-22 17:09:39 -04:00
ec_types.h bcachefs: Fix an include 2023-10-22 17:09:47 -04:00
ec.c bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
ec.h bcachefs: ec_stripe_delete_work() now takes ref on c->writes 2023-10-22 17:09:50 -04:00
errcode.c bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
errcode.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
error.c bcachefs: Improve btree node read error path 2023-10-22 17:09:50 -04:00
error.h bcachefs: Dump transaction updates before panicing 2023-10-22 17:09:49 -04:00
extent_update.c bcachefs: Use for_each_btree_key_upto() more consistently 2023-10-22 17:09:50 -04:00
extent_update.h bcachefs: Reduce iter->trans usage 2023-10-22 17:09:10 -04:00
extents_types.h
extents.c bcachefs: Better inlining in core write path 2023-10-22 17:09:49 -04:00
extents.h bcachefs: Better inlining in core write path 2023-10-22 17:09:49 -04:00
eytzinger.h bcachefs: Make eytzinger size parameter more conventional 2023-10-22 17:09:21 -04:00
fifo.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
fs-common.c bcachefs: Assorted checkpatch fixes 2023-10-22 17:09:44 -04:00
fs-common.h bcachefs: Add BCH_SUBVOLUME_UNLINKED 2023-10-22 17:09:15 -04:00
fs-io.c bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
fs-io.h bcachefs: Delete bch_writepage 2023-10-22 17:09:32 -04:00
fs-ioctl.c bcachefs: Support FS_XFLAG_PROJINHERIT 2023-10-22 17:09:43 -04:00
fs-ioctl.h
fs.c bcachefs: More errcode cleanup 2023-10-22 17:09:48 -04:00
fs.h bcachefs: Factor out two_state_shared_lock 2023-10-22 17:09:45 -04:00
fsck.c bcachefs: Use for_each_btree_key_upto() more consistently 2023-10-22 17:09:50 -04:00
fsck.h bcachefs: Drop bch2_fsck_inode_nlink() 2023-10-22 17:08:59 -04:00
inode.c bcachefs: bch2_inode_opts_get() 2023-10-22 17:09:49 -04:00
inode.h bcachefs: bch2_inode_opts_get() 2023-10-22 17:09:49 -04:00
io_types.h bcachefs: Error message improvement 2023-10-22 17:09:46 -04:00
io.c bcachefs: trans->notrace_relock_fail 2023-10-22 17:09:50 -04:00
io.h bcachefs: Kill BCH_WRITE_FLUSH 2023-10-22 17:09:45 -04:00
journal_io.c bcachefs: Log more messages in the journal 2023-10-22 17:09:48 -04:00
journal_io.h bcachefs: Log more messages in the journal 2023-10-22 17:09:48 -04:00
journal_reclaim.c bcachefs: Fix bch2_journal_flush_device_pins() 2023-10-22 17:09:48 -04:00
journal_reclaim.h bcachefs: Make sure to initialize j->last_flushed 2023-10-22 17:09:02 -04:00
journal_sb.c bcachefs: More errcode cleanup 2023-10-22 17:09:48 -04:00
journal_sb.h bcachefs: bch_sb_field_journal_v2 2023-10-22 17:09:29 -04:00
journal_seq_blacklist.c bcachefs: More errcode cleanup 2023-10-22 17:09:48 -04:00
journal_seq_blacklist.h Revert "bcachefs: Delete some obsolete journal_seq_blacklist code" 2023-10-22 17:09:21 -04:00
journal_types.h bcachefs: Log more messages in the journal 2023-10-22 17:09:48 -04:00
journal.c bcachefs: Convert EAGAIN errors to private error codes 2023-10-22 17:09:49 -04:00
journal.h bcachefs: Convert EAGAIN errors to private error codes 2023-10-22 17:09:49 -04:00
Kconfig bcachefs: time stats now uses the mean_and_variance module. 2023-10-22 17:09:43 -04:00
keylist_types.h
keylist.c bcachefs: New bpos_cmp(), bkey_cmp() replacements 2023-10-22 17:09:47 -04:00
keylist.h bcachefs: DIO write path optimization 2023-10-22 17:09:45 -04:00
lru.c bcachefs: Better inlining for bch2_alloc_to_v4_mut 2023-10-22 17:09:49 -04:00
lru.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
Makefile bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
mean_and_variance_test.c bcachefs: Mean and variance 2023-10-22 17:09:43 -04:00
mean_and_variance.c bcachefs: Mean and variance 2023-10-22 17:09:43 -04:00
mean_and_variance.h bcachefs: Mean and variance 2023-10-22 17:09:43 -04:00
migrate.c bcachefs: New btree helpers 2023-10-22 17:09:48 -04:00
migrate.h
move_types.h bcachefs: add progress stats to sysfs 2023-10-22 17:09:10 -04:00
move.c bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
move.h bcachefs: Fixes for building in userspace 2023-10-22 17:09:46 -04:00
movinggc.c bcachefs: Better inlining for bch2_alloc_to_v4_mut 2023-10-22 17:09:49 -04:00
movinggc.h bcachefs: Improve bucket_alloc_fail tracepoint 2023-10-22 17:09:36 -04:00
opts.c bcachefs: bch2_inode_opts_get() 2023-10-22 17:09:49 -04:00
opts.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
printbuf.c bcachefs: Printbuf rework 2023-10-22 17:09:33 -04:00
printbuf.h bcachefs: Printbuf rework 2023-10-22 17:09:33 -04:00
quota_types.h
quota.c bcachefs: Use for_each_btree_key_upto() more consistently 2023-10-22 17:09:50 -04:00
quota.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
rebalance_types.h bcachefs: add progress stats to sysfs 2023-10-22 17:09:10 -04:00
rebalance.c bcachefs: Fixes for building in userspace 2023-10-22 17:09:46 -04:00
rebalance.h
recovery.c bcachefs: Go RW before check_alloc_info() 2023-10-22 17:09:50 -04:00
recovery.h bcachefs: Fix btree_and_journal_iter 2023-10-22 17:09:33 -04:00
reflink.c bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
reflink.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
replicas_types.h bcachefs: Fix bch2_trans_reset_updates() 2023-10-22 17:09:50 -04:00
replicas.c bcachefs: Fix memleak in replicas_table_update() 2023-10-22 17:09:50 -04:00
replicas.h bcachefs: Fix bch2_trans_reset_updates() 2023-10-22 17:09:50 -04:00
siphash.c bcachefs: Assorted checkpatch fixes 2023-10-22 17:09:44 -04:00
siphash.h
six.c six locks: Improved optimistic spinning 2023-10-22 17:09:50 -04:00
six.h six locks: Improved optimistic spinning 2023-10-22 17:09:50 -04:00
str_hash.h bcachefs: Add private error codes for ENOSPC 2023-10-22 17:09:40 -04:00
subvolume_types.h bcachefs: darrays 2023-10-22 17:09:28 -04:00
subvolume.c bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
subvolume.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
super_types.h bcachefs: Freespace, need_discard btrees 2023-10-22 17:09:29 -04:00
super-io.c bcachefs: Convert EROFS errors to private error codes 2023-10-22 17:09:49 -04:00
super-io.h bcachefs: Freespace, need_discard btrees 2023-10-22 17:09:29 -04:00
super.c bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
super.h bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
sysfs.c bcachefs: Debug mode for c->writes references 2023-10-22 17:09:50 -04:00
sysfs.h bcachefs: Add persistent counters 2023-10-22 17:09:32 -04:00
tests.c bcachefs: Use for_each_btree_key_upto() more consistently 2023-10-22 17:09:50 -04:00
tests.h bcachefs: Add error handling to unit & perf tests 2023-10-22 17:08:48 -04:00
trace.c bcachefs: Tracepoint improvements 2023-10-22 17:09:38 -04:00
trace.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
two_state_shared_lock.c bcachefs: Factor out two_state_shared_lock 2023-10-22 17:09:45 -04:00
two_state_shared_lock.h bcachefs: Factor out two_state_shared_lock 2023-10-22 17:09:45 -04:00
util.c bcachefs: Use trylock in bch2_prt_backtrace() 2023-10-22 17:09:49 -04:00
util.h bcachefs: Delete atomic_inc_bug() 2023-10-22 17:09:46 -04:00
varint.c bcachefs: Add a valgrind memcheck hint 2023-10-22 17:09:13 -04:00
varint.h bcachefs: Add safe versions of varint encode/decode 2023-10-22 17:09:08 -04:00
vstructs.h bcachefs: Fix 32 bit build 2023-10-22 17:09:25 -04:00
xattr.c bcachefs: More errcode cleanup 2023-10-22 17:09:48 -04:00
xattr.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00