diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-04-13 20:45:55 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:54 +0200 |
commit | 5bbe4bf95bdd18500c5de52e5d38a91fbb5f6234 (patch) | |
tree | 31c270a338a7ad298ec5029342e76ba46919e15f /fs/bcachefs/sysfs.c | |
parent | bcachefs: Fix copygc threshold (diff) | |
download | linux-5bbe4bf95bdd18500c5de52e5d38a91fbb5f6234.tar.xz linux-5bbe4bf95bdd18500c5de52e5d38a91fbb5f6234.zip |
bcachefs: Add copygc wait to sysfs
Currently debugging an issue with copygc not running when it's supposed
to, and this is an obvious first step.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r-- | fs/bcachefs/sysfs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index 9f75f72f7b12..1f31458ffec9 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -188,6 +188,7 @@ rw_attribute(cache_replacement_policy); rw_attribute(label); rw_attribute(copy_gc_enabled); +read_attribute(copy_gc_wait); sysfs_pd_controller_attribute(copy_gc); rw_attribute(rebalance_enabled); @@ -336,6 +337,9 @@ SHOW(bch2_fs) sysfs_printf(rebalance_enabled, "%i", c->rebalance.enabled); sysfs_pd_controller_show(rebalance, &c->rebalance.pd); /* XXX */ sysfs_pd_controller_show(copy_gc, &c->copygc_pd); + sysfs_hprint(copy_gc_wait, + max(0LL, c->copygc_wait - + atomic64_read(&c->io_clock[WRITE].now)) << 9); if (attr == &sysfs_rebalance_work) { bch2_rebalance_work_to_text(&out, c); @@ -563,6 +567,7 @@ struct attribute *bch2_fs_internal_files[] = { &sysfs_prune_cache, &sysfs_copy_gc_enabled, + &sysfs_copy_gc_wait, &sysfs_rebalance_enabled, &sysfs_rebalance_work, |