linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cgroup io.stat propagation regression
@ 2024-05-14 19:25 Dan Schatzberg
  2024-05-15  3:59 ` Waiman Long
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Schatzberg @ 2024-05-14 19:25 UTC (permalink / raw)
  To: Waiman Long, Tejun Heo; +Cc: linux-block, cgroups, linux-kernel

Hi Waiman,

I've noticed that on recent kernels io.stat metrics don't propagate
all the way up the hierarchy. Specifically, io.stat metrics of some
leaf cgroup will be propagated to the parent, but not its grandparent.

For a simple repro, run the following:

systemd-run --slice test-test dd if=/dev/urandom of=/tmp/test bs=4096 count=1

Then:

cat /sys/fs/cgroup/test.slice/test-test.slice/io.stat

Shows the parent cgroup stats and I see wbytes=4096 but the grandparent cgroup:

cat /sys/fs/cgroup/test.slice/io.stat

shows no writes.

I believe this was caused by the change in "blk-cgroup: Optimize
blkcg_rstat_flush()". When blkcg_rstat_flush is called on the parent
cgroup, it exits early because the lockless list is empty since the
parent cgroup never issued writes itself (e.g. in
blk_cgroup_bio_start). However, in doing so it never propagated stats
to its parent.

Can you confirm if my understanding of the logic here is correct and
advise on a fix?

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

end of thread, other threads:[~2024-05-15 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 19:25 cgroup io.stat propagation regression Dan Schatzberg
2024-05-15  3:59 ` Waiman Long
2024-05-15 14:26   ` Waiman Long
2024-05-15 16:54     ` Dan Schatzberg
2024-05-15 17:51       ` Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).