Re: [PATCH] blk-cgroup: add CONFIG_BLK_CGROUP_DEBUG_STATS option

From: Breno Leitao

Date: Tue Mar 03 2026 - 09:07:17 EST


hello Michal,

First of all, sorry for being late here, I had some days off.

On Thu, Feb 12, 2026 at 11:26:29AM +0100, Michal Koutný wrote:
> On Wed, Feb 04, 2026 at 08:15:12AM -0800, Breno Leitao <leitao@xxxxxxxxxx> wrote:
> > 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.
>
> This seems to be toggleable quite easily anytime at runtime (not sysctl
> but modprobe config), not a boot cmdline where CONFIG_ default could
> step in.
>
> This only guards printing of already collected stats (sometimes even
> without kernel consumers), not sure if it's that useful.
>
> blk-cgroup isn't modularized since 32e380aedc3de ("blkcg: make
> CONFIG_BLK_CGROUP bool") v3.5-rc1~42^2~92 exposing it like a module
> parameter is historical artifact.
>
> So I'd dare to propose removing it altogether and print those stats
> everytime. Readers of the nested-keys format should survive that.
> (I don't even see the param documented.)
>
> And if there were eager readers that'd be affected performance-wise,
> more conventional would be to make this only boot cmdline parameter that
> could static-branch also the stat collection spots (for some more
> benefit). And then would also a CONFIG_urable default make sense.
>
> WDYT?

That seems to make sense and it also simplify kernel management. I am sending a
V2 with it, let's see if there is any other concern.