[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEi0FplA6eZUHF01@slm.duckdns.org>
Date: Tue, 10 Jun 2025 12:39:18 -1000
From: Tejun Heo <tj@...nel.org>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Muchun Song <muchun.song@...ux.dev>,
Vlastimil Babka <vbabka@...e.cz>,
Alexei Starovoitov <ast@...nel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Michal Koutný <mkoutny@...e.com>,
Harry Yoo <harry.yoo@...cle.com>,
Yosry Ahmed <yosry.ahmed@...ux.dev>, bpf@...r.kernel.org,
linux-mm@...ck.org, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org,
Meta kernel team <kernel-team@...a.com>
Subject: Re: [PATCH 2/3] cgroup: make css_rstat_updated nmi safe
Hello,
On Tue, Jun 10, 2025 at 03:31:03PM -0700, Shakeel Butt wrote:
...
> Couple of lines above I have llist_on_list(&rstatc->lnode) check which
> should be as cheap as data_race(css_rstat_cpu(css, cpu)->updated_next).
Ah, I missed that.
> So, I can add lnode for nmi and non-nmi contexts (with irqs disabled)
> but I think that is not needed. Actually I ran the netperf benchmark (36
> parallel instances) and I see no significant differences with and
> without the patch.
Yeah, as long as the hot path doesn't hit the extra cmpxchg, I think it
should be fine. Can you fortify the comments a bit that the synchronization
is against the stacking contexts on the same CPU. The use of cmpxchg for
something like this is a bit unusual and it'd be nice to have explanation on
why it's done this way and why the overhead doesn't matter.
Thanks.
--
tejun
Powered by blists - more mailing lists