From: Yosry Ahmed <yosry.ahmed@linux.dev>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Greg Thelen" <gthelen@google.com>, "Tejun Heo" <tj@kernel.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Eric Dumazet" <edumzaet@google.com>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
"Eric Dumazet" <edumazet@google.com>
Subject: Re: [PATCH] cgroup/rstat: avoid disabling irqs for O(num_cpu)
Date: Wed, 19 Mar 2025 18:35:02 +0000 [thread overview]
Message-ID: <Z9sOVsMtaZ9n02MZ@google.com> (raw)
In-Reply-To: <20250319180643.GC1876369@cmpxchg.org>
On Wed, Mar 19, 2025 at 02:06:43PM -0400, Johannes Weiner wrote:
> On Wed, Mar 19, 2025 at 05:16:02PM +0000, Yosry Ahmed wrote:
> > @@ -365,9 +352,8 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp)
> > void cgroup_rstat_flush_hold(struct cgroup *cgrp)
> > __acquires(&cgroup_rstat_lock)
> > {
> > - might_sleep();
> > + cgroup_rstat_flush(cgrp);
> > __cgroup_rstat_lock(cgrp, -1);
> > - cgroup_rstat_flush_locked(cgrp);
> > }
>
> Might as well remove cgroup_rstat_flush_hold/release entirely? There
> are no external users, and the concept seems moot when the lock is
> dropped per default. cgroup_base_stat_cputime_show() can open-code the
> lock/unlock to stabilize the counts while reading.
Yeah I missed the fact that the users are internal because the functions
are not static. I also don't see the point of keeping them.
Tejun/Greg, should I send a patch on top of this one or do you prefer
sending a new version?
> (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)
next prev parent reply other threads:[~2025-03-19 18:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 7:13 Greg Thelen
2025-03-19 7:17 ` Greg Thelen
2025-03-19 10:20 ` Michal Koutný
2025-03-19 10:47 ` Mateusz Guzik
2025-03-19 17:18 ` Yosry Ahmed
2025-03-27 14:38 ` Mateusz Guzik
2025-03-27 17:17 ` Yosry Ahmed
2025-03-27 17:47 ` Mateusz Guzik
2025-04-01 15:00 ` Michal Koutný
2025-04-01 15:46 ` Mateusz Guzik
2025-04-01 16:59 ` Michal Koutný
2025-03-19 17:26 ` Tejun Heo
2025-03-26 23:57 ` Mateusz Guzik
2025-03-19 17:16 ` Yosry Ahmed
2025-03-19 18:06 ` Johannes Weiner
2025-03-19 18:35 ` Yosry Ahmed [this message]
2025-03-19 19:10 ` Tejun Heo
2025-03-19 19:16 ` Johannes Weiner
2025-03-19 19:46 ` Johannes Weiner
2025-03-19 17:26 ` Tejun Heo
2025-03-19 17:35 ` Johannes Weiner
2025-03-19 17:53 ` Shakeel Butt
2025-03-19 18:37 ` Eric Dumazet
2025-03-20 14:43 ` Greg Thelen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9sOVsMtaZ9n02MZ@google.com \
--to=yosry.ahmed@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=edumazet@google.com \
--cc=edumzaet@google.com \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox