From: Kemeng Shi <shikemeng@huaweicloud.com>
To: akpm@linux-foundation.org, willy@infradead.org, jack@suse.cz,
bfoster@redhat.com, tj@kernel.org
Cc: dsterba@suse.com, mjguzik@gmail.com, dhowells@redhat.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org
Subject: [PATCH v5 3/5] writeback: fix build problems of "writeback: support retrieving per group debug writeback stats of bdi"
Date: Tue, 23 Apr 2024 11:46:41 +0800 [thread overview]
Message-ID: <20240423034643.141219-4-shikemeng@huaweicloud.com> (raw)
In-Reply-To: <20240423034643.141219-1-shikemeng@huaweicloud.com>
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
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
mm/backing-dev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 6ecd11bdce6e..e61bbb1bd622 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -172,7 +172,11 @@ static void wb_stats_show(struct seq_file *m, struct bdi_writeback *wb,
"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 seq_file *m, void *v)
unsigned long background_thresh;
unsigned long dirty_thresh;
struct bdi_writeback *wb;
- struct wb_stats stats;
global_dirty_limits(&background_thresh, &dirty_thresh);
--
2.30.0
next prev parent reply other threads:[~2024-04-23 3:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 3:46 [PATCH v5 0/5] Improve visibility of writeback Kemeng Shi
2024-04-23 3:46 ` [PATCH v5 1/5] writeback: collect stats of all wb of bdi in bdi_debug_stats_show Kemeng Shi
2024-04-23 3:46 ` [PATCH v5 2/5] writeback: support retrieving per group debug writeback stats of bdi Kemeng Shi
2024-04-23 3:46 ` Kemeng Shi [this message]
2024-04-23 3:53 ` [PATCH v5 3/5] writeback: fix build problems of "writeback: support retrieving per group debug writeback stats of bdi" Kemeng Shi
2024-04-24 13:27 ` Johannes Weiner
2024-04-25 1:22 ` Kemeng Shi
2024-04-23 3:46 ` [PATCH v5 4/5] writeback: add wb_monitor.py script to monitor writeback info on bdi Kemeng Shi
2024-04-23 3:46 ` [PATCH v5 5/5] writeback: rename nr_reclaimable to nr_dirty in balance_dirty_pages Kemeng Shi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240423034643.141219-4-shikemeng@huaweicloud.com \
--to=shikemeng@huaweicloud.com \
--cc=akpm@linux-foundation.org \
--cc=bfoster@redhat.com \
--cc=dhowells@redhat.com \
--cc=dsterba@suse.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mjguzik@gmail.com \
--cc=tj@kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox