summaryrefslogtreecommitdiff
path: root/fs/bcachefs/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-rw-r--r--fs/bcachefs/sysfs.c6
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,