Re: [PATCH v2] blk-cgroup: always display debug stats in io.stat

From: Tejun Heo

Date: Tue Mar 03 2026 - 12:47:38 EST


Hello,

On Tue, Mar 03, 2026 at 06:11:15AM -0800, Breno Leitao wrote:
> 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

The reason for gating is that these are more internal implementation details
and might change in the future.

> 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.

I'm not sure what the above para means. Module param works just fine for
built-in modules on both boot command line and through sysfs.

> Before (without blkcg_debug_stats enabled):
> 253:0 rbytes=6273024 wbytes=0 rios=20 wios=0 dbytes=0 dios=0 cost.usage=0
>
> After:
> 253:0 rbytes=6273024 wbytes=0 rios=20 wios=0 dbytes=0 dios=0 cost.usage=0 cost.wait=0 cost.indebt=0 cost.indelay=0

Given that they haven't changed for a long time, maybe it's okay to expose
them by default, but why? This is something which can be toggled on easily
at any time. What's the benefit of exposing these extra numbers which
probably don't mean much for most people?

Thanks.

--
tejun