blob: 47135c53d3a7449cbb50a5eb50c0c41fd0a82998 [file] [log] [blame]
From: Kemeng Shi <shikemeng@huaweicloud.com>
Subject: writeback: fix build problems of "writeback: support retrieving per group debug writeback stats of bdi"
Date: Tue, 23 Apr 2024 11:46:41 +0800
Fix two build problems:
1. implicit declaration of function 'cgroup_ino'.
2. unused variable 'stats'.
After this fix, No build problem is found when CGROUPS is disabled.
The wb_stats could be successfully retrieved when CGROUP_WRITEBACK is
disabled:
cat wb_stats
WbCgIno: 1
WbWriteback: 0 kB
WbReclaimable: 685440 kB
WbDirtyThresh: 195530960 kB
WbDirtied: 691488 kB
WbWritten: 6048 kB
WbWriteBandwidth: 102400 kBps
b_dirty: 2
b_io: 0
b_more_io: 0
b_dirty_time: 0
state: 5
cat wb_stats
WbCgIno: 1
WbWriteback: 0 kB
WbReclaimable: 818944 kB
WbDirtyThresh: 195527484 kB
WbDirtied: 824992 kB
WbWritten: 6048 kB
WbWriteBandwidth: 102400 kBps
b_dirty: 2
b_io: 0
b_more_io: 0
b_dirty_time: 0
state: 5
Link: https://lkml.kernel.org/r/20240423034643.141219-4-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reported-by: SeongJae Park <sj@kernel.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Brian Foster <bfoster@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/backing-dev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/mm/backing-dev.c~writeback-support-retrieving-per-group-debug-writeback-stats-of-bdi-fix
+++ a/mm/backing-dev.c
@@ -172,7 +172,11 @@ static void wb_stats_show(struct seq_fil
"b_more_io: %10lu\n"
"b_dirty_time: %10lu\n"
"state: %10lx\n\n",
+#ifdef CONFIG_CGROUP_WRITEBACK
cgroup_ino(wb->memcg_css->cgroup),
+#else
+ 1ul,
+#endif
K(stats->nr_writeback),
K(stats->nr_reclaimable),
K(stats->wb_thresh),
@@ -192,7 +196,6 @@ static int cgwb_debug_stats_show(struct
unsigned long background_thresh;
unsigned long dirty_thresh;
struct bdi_writeback *wb;
- struct wb_stats stats;
global_dirty_limits(&background_thresh, &dirty_thresh);
_