diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-08-23 03:49:55 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:39 +0200 |
commit | 616928c30f594775953ca75eb7ccc312a8abeb73 (patch) | |
tree | 0fe31e512c6f2b543b3dcf77a0e18c9f4bc32f3e /fs/bcachefs/debug.c | |
parent | six locks: Improve six_lock_count (diff) | |
download | linux-616928c30f594775953ca75eb7ccc312a8abeb73.tar.xz linux-616928c30f594775953ca75eb7ccc312a8abeb73.zip |
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>
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r-- | fs/bcachefs/debug.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index 86c4b023ac7c..4fe20d36212e 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -667,6 +667,9 @@ static ssize_t lock_held_stats_read(struct file *file, char __user *buf, mutex_lock(&s->lock); + prt_printf(&i->buf, "Max mem used: %u", s->max_mem); + prt_newline(&i->buf); + if (IS_ENABLED(CONFIG_BCACHEFS_LOCK_TIME_STATS)) { prt_printf(&i->buf, "Lock hold times:"); prt_newline(&i->buf); |