diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-04-01 04:07:37 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:58 +0300 |
commit | ba5f03d362a8c7a32fd63c54cd3aeea0c9f3d7cc (patch) | |
tree | 28737b92313da213b1489195b7fbe0e988e74d10 /fs/bcachefs/btree_io.c | |
parent | d5a43661a1e9d9448e9e508470deec973c3d6644 (diff) | |
download | linux-ba5f03d362a8c7a32fd63c54cd3aeea0c9f3d7cc.tar.xz |
bcachefs: Add a sysfs var for average btree write size
Useful number for performance tuning.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_io.c')
-rw-r--r-- | fs/bcachefs/btree_io.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c index fc94782afb60..3b45389a8e06 100644 --- a/fs/bcachefs/btree_io.c +++ b/fs/bcachefs/btree_io.c @@ -1551,6 +1551,9 @@ void __bch2_btree_node_write(struct bch_fs *c, struct btree *b, b->written += sectors_to_write; + atomic64_inc(&c->btree_writes_nr); + atomic64_add(sectors_to_write, &c->btree_writes_sectors); + /* XXX: submitting IO with btree locks held: */ bch2_submit_wbio_replicas(&wbio->wbio, c, BCH_DATA_btree, k.k); bch2_bkey_buf_exit(&k, c); |