diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-01 14:21:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-01 16:49:42 -0400 |
commit | c81f0b722fe7cdede89b514fe8c0432ec07af048 (patch) | |
tree | 513ff49f6d96733a86ca885cd06280cb4bd369e2 /fs/bcachefs/sysfs.c | |
parent | 7609e7fa650e0ccc3de002423cbd5bcd3165bf6c (diff) |
bcachefs: Don't promote when target is congestedpromote
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-rw-r--r-- | fs/bcachefs/sysfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index e4381bb5da19..65345d80e4f4 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -147,6 +147,7 @@ read_attribute(io_latency_read); read_attribute(io_latency_write); read_attribute(io_latency_stats_read); read_attribute(io_latency_stats_write); +read_attribute(congested); read_attribute(bucket_quantiles_last_read); read_attribute(bucket_quantiles_last_write); @@ -874,6 +875,10 @@ SHOW(bch2_dev) if (attr == &sysfs_io_latency_stats_write) return bch2_time_stats_print(&ca->io_latency[WRITE], buf, PAGE_SIZE); + sysfs_printf(congested, "%u%%", + clamp(atomic_read(&ca->congested), 0, CONGESTED_MAX) + * 100 / CONGESTED_MAX); + if (attr == &sysfs_bucket_quantiles_last_read) return show_quantiles(c, ca, buf, bucket_last_io_fn, (void *) 0); if (attr == &sysfs_bucket_quantiles_last_write) @@ -970,6 +975,7 @@ struct attribute *bch2_dev_files[] = { &sysfs_io_latency_write, &sysfs_io_latency_stats_read, &sysfs_io_latency_stats_write, + &sysfs_congested, /* alloc info - other stats: */ &sysfs_bucket_quantiles_last_read, |