Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2696220lqt; Mon, 22 Apr 2024 20:47:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWl8IFg51yHUOalG8N9Fvc//oU6lxrC//Ay5IixXHW9nuLiaGbwWNdiQ52pFArAtwBOIptyNZyHFrhwoH0Hw6BWo/XavSDTlfcjY2e2MA== X-Google-Smtp-Source: AGHT+IHZz+jiajAK9zHmKc611D/6Skxcu/x3rPAPM+uNURqc+vPbpxJNF2/fKPm7gJf2PxAmfo+i X-Received: by 2002:a05:620a:20c7:b0:78d:32d3:8a52 with SMTP id f7-20020a05620a20c700b0078d32d38a52mr13656861qka.22.1713844047610; Mon, 22 Apr 2024 20:47:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713844047; cv=pass; d=google.com; s=arc-20160816; b=eAc81Uk2uqcbstYmzEvYSc+mVqlswCEZM/ProsHOpIFS4eYEnE4F9vU9orxjnftDaq zohNbn+RNQUyazW7FczM5LEtQJp+0iyjV3PvB+GpsUuNw5/EsnMwwEl9p0XUxqJvp9fn 8++76k7gyvJZ8jBwoWXyI6CD5lNYk2iA1QvShfJPExBNqsv8QYIxtfpAIDOM8LVAg+J7 WPo5jrihdi9E1DBU1zona7u9iWuLWn8PpHt5/Xq+7UdaHVcR+du62OXjlC+scx+Jm2aq MKIoFBvaw8K7ou9DLKUYbKAE2Iei0t/UEVC6MyCdEBXuKos6GTh2VpaLzN3334oC6c2q 3bRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=VUlNcYHMAY3tW29yGpKqfhHjbBsuRXaabM64a268Vio=; fh=g5Vs1VxAx2X8vmiL10fG4wDuSmQozck6+rQBLp7+mS0=; b=tC+hf3VjN8kh3MQ5CO7qp3PFTYBpTqF32QvUFSAfhynL5TfghRl5ybEnVv3FRU6clK AbZCdrZhYKoQpZuFznskjBhsK4yNo5zcWzQ/KsreX/jhNALjNx8m5H4cjmXSLgMMrh0F 3wSzyzbQt9busT3i4HJI5g7d2YcNVEKPW/ClY4Rjkk+DUQt4W+xnoMd2CZ162nOmFBFY UsspzCbflUxQBwJOaGhTMy3CxL8nFhstjFPGx31VTFysbe26e7xDIvauo6efGQJa6JNe nZU8LP8/HYjmutlT5e9f+Yk1HKElA6vTL3Rfm0mpOG44sYZ3YMVc8PfsI7J9tp/oV8kp 8oYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-154471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154471-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f11-20020a05620a12eb00b0078eff6f05c8si11563025qkl.569.2024.04.22.20.47.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 20:47:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-154471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154471-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 583741C21933 for ; Tue, 23 Apr 2024 03:47:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07CBD208A0; Tue, 23 Apr 2024 03:46:53 +0000 (UTC) Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 503471C2AD; Tue, 23 Apr 2024 03:46:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713844012; cv=none; b=DtFbFroFsD+PdOFkGxt2PZPueHpjjTlH1LvNEiGERMEbXA2Ri+QDaYgP7dQ8OWKgKaCYoCzUaiO2Wf6nnbaanDjvztaJN+AiEEZyrOd0q7wfDowv6cbGp1AVROg556IRyB9iGiAsLoOKEey4WkE2YL6TXh15fR62kQDqQ8+QVjU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713844012; c=relaxed/simple; bh=Oyn7Q/Z8KOp/GJK2P/SS60hLeCHJaTrxuzeGkcub8ds=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=I2Uk+6O8fXzOIIQssxv239/pJeJP154RqolkD5vW+ZC4DHWaokmpygLIah1iOf94A7/Dc1AqUZiNqF3BenaJv/aZw0AfOCC3logrgWaf4BtTseEeRtwAP/Ny+Gima4oglZsWSqaQQTBpI43zb/gj/z3ql+xHPLOZ5PYzZBQZQAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VNp2V2Rbpz4f3kpB; 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 283661A016E; 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:Syh0CgA3Ww4kLydmKkDYKw--.11241S5 X-Coremail-Antispam: 1UD129KBjvJXoW7Cw13JrWUWryrCFy8Cw47twb_yoW8WF43p3 W3Gw40kw1UZF9FgFZxCayUWr98tw45ta47XFyDArW3t3WFqrnrGFyfGay8Zry7ZF93Jay3 ZanYvryxJrZFyr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB0b4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUWw A2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMc Ij6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_ Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUFYFCUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ 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 --- 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