From nobody Thu Apr 9 18:00:24 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 3244B362121; Tue, 3 Mar 2026 14:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772547097; cv=none; b=Ka3io60gXCV0cloMsWmaNPyMgTG4iBehSPSF0OPjXQIxdqrKuffTN3cx5HEC9ya0jmqASkQfwF9GRHHGYXDJ9Fqkha1mYJwCUnF7aojmLxpzIdNDRXaquxCO2B8vW9zOWUejHn5lYZcj26BdvzhTaELFC3fkshmJvpdBrO/g6yA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772547097; c=relaxed/simple; bh=gRb5Q9YI+ym8+95kKkS+hRTOyMkhQ5+z/S0MPFREgQ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=sN8+5pj3CvPFaOCkz8zCyV+ppT5rTReht2rcczZPW/Jf0dQWn+TUZUuh7itO2ReUVfrcS0MphHRqEJZJba4fgN7qeKDUrIne9cUeKlLj0eka/2B0gYLjWG0h3phbHwJicTo2qRKnJrhq+Hm/w7eSHkM9S+61XLuM9JBZj+px0No= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=none smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=GSbjRNaI; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="GSbjRNaI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Reply-To:Content-ID:Content-Description:In-Reply-To:References; bh=/sc0gv5n3HTa2+ensifFm2Ixdrdjn5M3YKYyX65Jgk4=; b=GSbjRNaI9Tw45hJXi2j6h5lyh0 FKIRfkSEg7sgd3Oa9/LSEsSZNY2LoBDn86eWXkisWs0DJrjVq84IsOEA5QUMbsmTsYtl3ecEbNqpW sc2I4Oqqz7bECQrsgpUTKqb+O1Ej9tblQiaHLvDGkG0wsOnH6XqEije+yRmEfzUJEvc1bOUkhgCoJ HrzDsJzWkGGfV2zS9JlRIkZU9AE+aiMz395i4Ct/fRxQegnQ5iHxQ6fd2Ey9eGCgY4GAls2xXxtvW ydszWVgq68Mg55w036Mt7EuOkcoum1LNeYHWFqArf7uhwGrzyR5aEJChG6mH+wLfDg3lPdMyO8XXG 7BrBMcLw==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1vxQTD-00FEjl-P7; Tue, 03 Mar 2026 14:11:32 +0000 From: Breno Leitao Date: Tue, 03 Mar 2026 06:11:15 -0800 Subject: [PATCH v2] blk-cgroup: always display debug stats in io.stat Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260303-blk_cgroup_debug_stats-v2-1-196c713cb762@debian.org> X-B4-Tracking: v=1; b=H4sIAAPspmkC/4WNSwqDMBQArxLe2pQkTetn1XsUEROfMW0xkhelR bx70R6gy4FhZgXC6JGgYitEXDz5MELFVMbADu3okPsOKgZKqKtQQnPzejbWxTBPTYdmdg2lNhH HQpqiyPvSngVkDKaIvX8f4Xv9Y5rNA23aa7sxeEohfo7zInfv72SRXHJRWpFftNFKq1uHxrfjK UQH9bZtX3GbGBbPAAAA X-Change-ID: 20260204-blk_cgroup_debug_stats-e81b887f9c30 To: Jens Axboe , Tejun Heo , Josef Bacik Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, thevlad@meta.com, kernel-team@meta.com, =?utf-8?q?Michal_Koutn=C3=BD?= , Breno Leitao X-Mailer: b4 0.15-dev-f4305 X-Developer-Signature: v=1; a=openpgp-sha256; l=4080; i=leitao@debian.org; h=from:subject:message-id; bh=gRb5Q9YI+ym8+95kKkS+hRTOyMkhQ5+z/S0MPFREgQ4=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBppuwP/L99GgvgPkddfNY6PW3omGvIjY27ZpX0R mJO+rBeTJGJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaabsDwAKCRA1o5Of/Hh3 bZg+D/9bKc2EUQrurpSAhVc5Ua+wIhLsNFwKI7qtxGP+1uU+kaD0J2BDZiUynt2ot/DErQiBa18 uE6Aa2E1FCKUObtbWI9Q/SfWQ0BjIjeM/cVPdyEPAq6V8KMxK+2OXagoVIEkLZVL7NRhIUorIy4 D6WAnu8YQ5D6X+LPsGWUgXFEZEisGZZM422xVeFq8FklOYKIqpYbLQ6IfVczoT6QWzxfbPGnxtC +U49m38vV1AIWoxbJyuHOjKNMUyVmHLTy0oc96A/t1MSjICk6qdHRi4f9ttPnUBGMpoigtQBuXP NvhfOe6uq34//BpOA51ime/wSbgv8fMudkIUd4/IxhwxMvNfz3RHaVksqqa8w4Dec3ZTnRrMCYA /1yjYFyK0jBpKO4ibbItndhpLUP437EWB/DCQMfBIv81dWFkDpDo89l33tyr+MeCVJH7uIUkLjc LoQCiaz6Whm8DyAkMGZYGxf9EFNUeGsgGxU1ROUwrS600fe5BIS7VcqyIp7bMq9goAFLY9B4BkV 9s+060DLYQmW94lE5u2RzrhzwvwmlLmXa5pdoHZb40Mvq/1+/SA0jeMU9lpsdb1JIvLhySb+bxv YzAqybv4AZBY4IcY7YZHi23lxVqGeLijFtsvQvg+G0IFYEL+fbl4XBl8aNZ9Gv/IDIM7nsQ7vNq t1SK3Se4G9RyKew== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Remove the blkcg_debug_stats toggle and always display detailed statistics in the cgroup io.stat file. This includes use_delay and delay_nsec information, cost.wait/cost.indebt/cost.indelay for iocost, and latency statistics for iolatency. The stats are already being collected regardless of the toggle, so gating their display provides no real benefit. Additionally, blk-cgroup has not been modularized since commit 32e380aedc3de ("blkcg: make CONFIG_BLK_CGROUP bool"), making the module parameter a historical artifact. Readers of the nested-keys format should be able to handle additional fields. Before (without blkcg_debug_stats enabled): 253:0 rbytes=3D6273024 wbytes=3D0 rios=3D20 wios=3D0 dbytes=3D0 dios=3D0 = cost.usage=3D0 After: 253:0 rbytes=3D6273024 wbytes=3D0 rios=3D20 wios=3D0 dbytes=3D0 dios=3D0 = cost.usage=3D0 cost.wait=3D0 cost.indebt=3D0 cost.indelay=3D0 Suggested-by: Michal Koutn=C3=BD Signed-off-by: Breno Leitao --- Changes in v2: - Remove blkcg_debug_stats instead of creating a CONFIG_ to set it. (Michal) - Link to v1: https://patch.msgid.link/20260204-blk_cgroup_debug_stats-v1-1= -09c0754b4242@debian.org --- block/blk-cgroup.c | 6 +----- block/blk-cgroup.h | 1 - block/blk-iocost.c | 9 ++++----- block/blk-iolatency.c | 3 --- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index b70096497d389..8b89a1ce6927a 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -56,8 +56,6 @@ static struct blkcg_policy *blkcg_policy[BLKCG_MAX_POLS]; =20 static LIST_HEAD(all_blkcgs); /* protected by blkcg_pol_mutex */ =20 -bool blkcg_debug_stats =3D false; - static DEFINE_RAW_SPINLOCK(blkg_stat_lock); =20 #define BLKG_DESTROY_BATCH_SIZE 64 @@ -1209,7 +1207,7 @@ static void blkcg_print_one_stat(struct blkcg_gq *blk= g, struct seq_file *s) dbytes, dios); } =20 - if (blkcg_debug_stats && atomic_read(&blkg->use_delay)) { + if (atomic_read(&blkg->use_delay)) { seq_printf(s, " use_delay=3D%d delay_nsec=3D%llu", atomic_read(&blkg->use_delay), atomic64_read(&blkg->delay_nsec)); @@ -2246,5 +2244,3 @@ bool blk_cgroup_congested(void) return ret; } =20 -module_param(blkcg_debug_stats, bool, 0644); -MODULE_PARM_DESC(blkcg_debug_stats, "True if you want debug stats, false i= f not"); diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 1cce3294634d1..ac38bc3e2486b 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -189,7 +189,6 @@ struct blkcg_policy { }; =20 extern struct blkcg blkcg_root; -extern bool blkcg_debug_stats; =20 void blkg_init_queue(struct request_queue *q); int blkcg_init_disk(struct gendisk *disk); diff --git a/block/blk-iocost.c b/block/blk-iocost.c index d145db61e5c31..a913e67d0f695 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -3060,11 +3060,10 @@ static void ioc_pd_stat(struct blkg_policy_data *pd= , struct seq_file *s) =20 seq_printf(s, " cost.usage=3D%llu", iocg->last_stat.usage_us); =20 - if (blkcg_debug_stats) - seq_printf(s, " cost.wait=3D%llu cost.indebt=3D%llu cost.indelay=3D%llu", - iocg->last_stat.wait_us, - iocg->last_stat.indebt_us, - iocg->last_stat.indelay_us); + seq_printf(s, " cost.wait=3D%llu cost.indebt=3D%llu cost.indelay=3D%llu", + iocg->last_stat.wait_us, + iocg->last_stat.indebt_us, + iocg->last_stat.indelay_us); } =20 static u64 ioc_weight_prfill(struct seq_file *sf, struct blkg_policy_data = *pd, diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 53e8dd2dfa8ad..e99abc97050a0 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -946,9 +946,6 @@ static void iolatency_pd_stat(struct blkg_policy_data *= pd, struct seq_file *s) unsigned long long avg_lat; unsigned long long cur_win; =20 - if (!blkcg_debug_stats) - return; - if (iolat->ssd) return iolatency_ssd_stat(iolat, s); =20 --- base-commit: d517cb8cea012f43b069617fc8179b45404f8018 change-id: 20260204-blk_cgroup_debug_stats-e81b887f9c30 Best regards, -- =20 Breno Leitao