Re: [PATCH] cgroup/rstat: avoid disabling irqs for O(num_cpu)

From: Johannes Weiner
Date: Wed Mar 19 2025 - 15:46:19 EST


On Wed, Mar 19, 2025 at 03:16:42PM -0400, Johannes Weiner wrote:
> On Wed, Mar 19, 2025 at 06:35:02PM +0000, Yosry Ahmed wrote:
> > On Wed, Mar 19, 2025 at 02:06:43PM -0400, Johannes Weiner wrote:
> > > (btw, why do we not have any locking around the root stats in
> > > cgroup_base_stat_cputime_show()? There isn't anything preventing a
> > > reader from seeing all zeroes if another reader runs the memset() on
> > > cgrp->bstat, is there? Or double times...)
> >
> > (I think root_cgroup_cputime() operates on a stack allocated bstat, not
> > cgrp->bstat)
>
> That was the case until:
>
> commit b824766504e49f3fdcbb8c722e70996a78c3636e
> Author: Chen Ridong <chenridong@xxxxxxxxxx>
> Date: Thu Jul 4 14:01:19 2024 +0000

Nevermind, Tejun pointed me to the follow-up fix he's got already
queued up:

https://web.git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/commit/?id=c4af66a95aa3bc1d4f607ebd4eea524fb58946e3

That brings it all back on the stack.