summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-11 11:11:22 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 11:47:44 -0500
commit31403dca5bb1e55ea0ea6ad1264b81fa8c9a3768 (patch)
tree91a8417b8242fa3702100c718a829cfc17d1aa2c /fs/bcachefs/btree_types.h
parentfea153a84557c982542527143950dbef434731c2 (diff)
downloadlinux-31403dca5bb1e55ea0ea6ad1264b81fa8c9a3768.tar.gz
linux-31403dca5bb1e55ea0ea6ad1264b81fa8c9a3768.tar.bz2
linux-31403dca5bb1e55ea0ea6ad1264b81fa8c9a3768.zip
bcachefs: optimize __bch2_trans_get(), kill DEBUG_TRANSACTIONS
- Some tweaks to greatly reduce locking overhead for the list of btree transactions, so that it can always be enabled: leave btree_trans objects on the list when they're on the percpu single item freelist, and only check for duplicates in the same process when CONFIG_BCACHEFS_DEBUG is enabled - don't zero out the full btree_trans() unless we allocated it from the mempool Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
-rw-r--r--fs/bcachefs/btree_types.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index 28bac4ce20e1..3baf688177c4 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -386,7 +386,6 @@ struct btree_trans {
void *mem;
unsigned mem_top;
- unsigned mem_max;
unsigned mem_bytes;
btree_path_idx_t nr_sorted;
@@ -413,8 +412,6 @@ struct btree_trans {
unsigned long srcu_lock_time;
const char *fn;
- struct closure ref;
- struct list_head list;
struct btree_bkey_cached_common *locking;
struct six_lock_waiter locking_wait;
int srcu_idx;
@@ -424,7 +421,6 @@ struct btree_trans {
u16 journal_entries_size;
struct jset_entry *journal_entries;
- struct btree_insert_entry updates[BTREE_ITER_MAX];
struct btree_trans_commit_hook *hooks;
struct journal_entry_pin *journal_pin;
@@ -435,6 +431,13 @@ struct btree_trans {
unsigned extra_disk_res; /* XXX kill */
struct replicas_delta_list *fs_usage_deltas;
+ /* Entries before this are zeroed out on every bch2_trans_get() call */
+
+ struct btree_insert_entry updates[BTREE_ITER_MAX];
+
+ struct list_head list;
+ struct closure ref;
+
unsigned long _paths_allocated[BITS_TO_LONGS(BTREE_ITER_MAX)];
struct btree_trans_paths trans_paths;
struct btree_path _paths[BTREE_ITER_MAX];