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-04 13:47:54 -0400 |
commit | d5e73ca148dc8ceb9c2125f4817674a2f5c7df60 (patch) | |
tree | e0e788aa40f9bd0771a3a00a204a673ff7192005 /fs/bcachefs/sysfs.c | |
parent | fc837b568a5dea0215ea5c5ce271eb3c1c70b956 (diff) |
bcachefs: Don't promote when target is congestedbcachefs-v4.15
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, |