lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260204-blk_cgroup_debug_stats-v1-1-09c0754b4242@debian.org>
Date: Wed, 04 Feb 2026 08:15:12 -0800
From: Breno Leitao <leitao@...ian.org>
To: Jens Axboe <axboe@...nel.dk>, Tejun Heo <tj@...nel.org>, 
 Josef Bacik <josef@...icpanda.com>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, 
 cgroups@...r.kernel.org, thevlad@...a.com, kernel-team@...a.com, 
 Breno Leitao <leitao@...ian.org>
Subject: [PATCH] blk-cgroup: add CONFIG_BLK_CGROUP_DEBUG_STATS option

Add a Kconfig option to enable blkcg_debug_stats by default at compile
time. When CONFIG_BLK_CGROUP_DEBUG_STATS is enabled, additional debugging
information is shown in the cgroup io.stat file, including cost.wait,
cost.indebt, and cost.indelay for iocost, as well as latency statistics
for iolatency.

The runtime module parameter blkcg_debug_stats remains functional,
allowing the setting to be toggled regardless of the compile-time
default.

Signed-off-by: Breno Leitao <leitao@...ian.org>
---
This option is commonly enabled by some hyperscalers, either through the
command line or custom patches. Let's make it part of the kernel.
---
 block/Kconfig      | 15 +++++++++++++++
 block/blk-cgroup.c |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/block/Kconfig b/block/Kconfig
index 15027963472d7..03fb95a24564c 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -170,6 +170,21 @@ config BLK_CGROUP_IOPRIO
 	scheduler and block devices process requests. Only some I/O schedulers
 	and some block devices support I/O priorities.
 
+config BLK_CGROUP_DEBUG_STATS
+	bool "Enable blkcg debug stats by default"
+	depends on BLK_CGROUP
+	default n
+	help
+	Enable blkcg debug stats by default. This provides additional
+	debugging information in the cgroup io.stat file, including
+	cost.wait, cost.indebt, cost.indelay for iocost and latency
+	statistics for iolatency.
+
+	This can also be enabled at runtime via the blkcg_debug_stats
+	module parameter.
+
+	If unsure, say N.
+
 config BLK_DEBUG_FS
 	bool "Block layer debugging information in debugfs"
 	default y
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 3cffb68ba5d87..67687d02b3cbc 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -56,7 +56,7 @@ static struct blkcg_policy *blkcg_policy[BLKCG_MAX_POLS];
 
 static LIST_HEAD(all_blkcgs);		/* protected by blkcg_pol_mutex */
 
-bool blkcg_debug_stats = false;
+bool blkcg_debug_stats = IS_ENABLED(CONFIG_BLK_CGROUP_DEBUG_STATS);
 
 static DEFINE_RAW_SPINLOCK(blkg_stat_lock);
 

---
base-commit: 4c87cdd0328495759f6e9f9f4e1e53ef8032a76f
change-id: 20260204-blk_cgroup_debug_stats-e81b887f9c30

Best regards,
--  
Breno Leitao <leitao@...ian.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ