bcachefs: Track maximum transaction memory
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 23 Aug 2022 01:49:55 +0000 (21:49 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:39 +0000 (17:09 -0400)
commit616928c30f594775953ca75eb7ccc312a8abeb73
tree0fe31e512c6f2b543b3dcf77a0e18c9f4bc32f3e
parente3738c6909d69e980d8b56d33df2e438a2c1c798
bcachefs: Track maximum transaction memory

This patch
 - tracks maximum bch2_trans_kmalloc() memory used in btree_transaction_stats
 - makes it available in debugfs
 - switches bch2_trans_init() to using that for the amount of memory to
   preallocate, instead of the parameter passed in

This drastically reduces transaction restarts, and means we no longer
need to track this in the source code.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_types.h
fs/bcachefs/debug.c