mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] blkcg: decouple cgroup v1 I/O accounting from throttling
@ 2026-11-10 10:31 Zhe Liu
  2026-11-10 10:31 ` [PATCH 1/3] blkcg: allow printing rwstat samples without policy data Zhe Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Zhe Liu @ 2026-11-10 10:31 UTC (permalink / raw)
  To: axboe, tj, josef; +Cc: yukuai, linux-block, linux-kernel, cgroups, Zhe Liu

Commit a3166c51702b ("blk-throttle: delay initialization until
configuration") deferred throttle policy activation until an I/O limit is
configured. However, cgroup v1 accounting still lives in the throttle
policy and is performed after the activation check in blk_should_throtl().
Without an activated throttle policy, v1 statistics such as
blkio.throttle.io_service_bytes remain zero even while I/O is issued.

This forces cgroup v1 users to configure the throttle policy just
to obtain I/O statistics, even when no throttling is needed.

This series moves cgroup v1 I/O statistics into blkcg and performs
accounting before checking throttle activation. It also moves
statistics reporting, reset and offline propagation into blkcg,
while preserving recursive aggregation and existing userspace
interfaces. With these changes, cgroup v1 I/O statistics work
without configuring throttle rules, while lazy throttle
initialization is preserved.

A/B-tested on linux-next (next-20261109) under QEMU (x86_64, TCG)
with the same kernel configuration. With no throttle rule, a 4 KiB
direct write accounted for 0 bytes and 0 BIOs on the baseline.
With the series applied, the same write accounted for 4096 bytes
and 1 BIO. A 1 MiB direct write split into 64 KiB BIOs accounted
for 1048576 bytes and 16 BIOs with the series applied.

Zhe Liu (3):
  blkcg: allow printing rwstat samples without policy data
  blkcg: move cgroup v1 I/O statistics out of the throttle policy
  blkcg: account cgroup v1 I/O before checking throttle activation

 block/blk-cgroup-rwstat.c |  18 ++--
 block/blk-cgroup-rwstat.h |   2 +
 block/blk-cgroup.c        | 188 +++++++++++++++++++++++++++++++++++++-
 block/blk-cgroup.h        |  15 +++
 block/blk-core.c          |   1 +
 block/blk-merge.c         |   9 +-
 block/blk-throttle.c      |  78 ---------------
 block/blk-throttle.h      |  12 +--
 8 files changed, 224 insertions(+), 99 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-10 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 10:31 [PATCH 0/3] blkcg: decouple cgroup v1 I/O accounting from throttling Zhe Liu
2026-11-10 10:31 ` [PATCH 1/3] blkcg: allow printing rwstat samples without policy data Zhe Liu
2026-11-10 10:32 ` [PATCH 2/3] blkcg: move cgroup v1 I/O statistics out of the throttle policy Zhe Liu
2026-11-10 10:32 ` [PATCH 3/3] blkcg: account cgroup v1 I/O before checking throttle activation Zhe Liu
2026-11-10 16:06 ` [PATCH 0/3] blkcg: decouple cgroup v1 I/O accounting from throttling Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®