From patchwork Tue Apr 23 03:46:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13639284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64B77C04FFE for ; Tue, 23 Apr 2024 03:46:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C3D66B0099; Mon, 22 Apr 2024 23:46:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75F9D6B00A0; Mon, 22 Apr 2024 23:46:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5118B6B009B; Mon, 22 Apr 2024 23:46:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2660D6B0098 for ; Mon, 22 Apr 2024 23:46:55 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id CC0E7A14DC for ; Tue, 23 Apr 2024 03:46:54 +0000 (UTC) X-FDA: 82039410348.03.C75AF1D Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf15.hostedemail.com (Postfix) with ESMTP id 597D2A0003 for ; Tue, 23 Apr 2024 03:46:50 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf15.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713844013; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VUlNcYHMAY3tW29yGpKqfhHjbBsuRXaabM64a268Vio=; b=FRI0NbSB0Ahn7DrWBtcI0fHspT8g8TcEdoHtpOmYb5p5tA696mkdNKAUybWSJ6lCLQm8Bw V3hZfD0EU5duzE4DCbccIrEce6cMW55CwJzuDCA2YOCFb2XzQ6Ik9QDfNM+uCQ83GIVjBz fdbusgiiOvsJbksyNE4hnKegLBV763M= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713844013; a=rsa-sha256; cv=none; b=OibIFUL/plpB5G9GJ0I50PqVRZToNCDHMHVN/Iv7fKh1GbJHrHU08A6d1Q8dlXNJ+Oeusa c3WiggsgFL6AWpE/1wc1w9X16HMOKTiHCBoJbO3nUP6tRKpN2NRENsP7/xGlB4LSC1Fniw fmpafAtRWzanWcoRmS5TZKY2R2D7EEA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf15.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VNp2V1Yhcz4f3kp5 for ; Tue, 23 Apr 2024 11:46:42 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 0A5071A0568 for ; Tue, 23 Apr 2024 11:46:47 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP2 (Coremail) with SMTP id Syh0CgA3Ww4kLydmKkDYKw--.11241S5; Tue, 23 Apr 2024 11:46:46 +0800 (CST) From: Kemeng Shi 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 Message-Id: <20240423034643.141219-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240423034643.141219-1-shikemeng@huaweicloud.com> References: <20240423034643.141219-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgA3Ww4kLydmKkDYKw--.11241S5 X-Coremail-Antispam: 1UD129KBjvJXoW7Cw13JrWUWryrCFy8Cw47twb_yoW8WF43p3 W3Gw40kw1UZF9FgFZxCayUWr98tw45ta47XFyDArW3t3WFqrnrGFyfGay8Zry7ZF93Jay3 ZanYvryxJrZFyr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB0b4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUWw A2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMc Ij6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_ Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij64 vIr41l4I8I3I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BjNDgzOilMNM0k/PHFcJhcwG923IYnXPChExquhghP6il1Civon7cCgV/2lhmRByAm7SXq/rBX5LO5ezulj7u9f7xPsTaTF/8G2WhWBKZbyas9Hh+HHPThbBDSNgkqJwUjUOwuHCOu5hXTgiB/EVpu1TvcPkLW0bwxdpAAQJbBGVi1EE+Tuap11tSJn4PQWFVznkEM1XTM+obkgq27p6cXEbY+GdeddBdtHlQ6Se4ZpNQBNGD6YU2vDxR1q29Rq13/OUSGGH9pbCl3rT8u9Vk08wRyVawWO4S9mChEnVU5lDMgcyL3qIExhNRmmj8q5dSBE+RhOEpTMvfu4IHHM X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 Reported-by: SeongJae Park Reported-by: Stephen Rothwell --- 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);