From: Gregory Price <gourry@gourry.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, rppt@kernel.org, vbabka@kernel.org,
mgorman@techsingularity.net, hannes@cmpxchg.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] mm/vmstat: fold stranded per-cpu node stats when a node comes online
Date: Tue, 30 Jun 2026 19:27:48 -0400 [thread overview]
Message-ID: <akRQ9KB6-HzLwqwC@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20260630155517.38a99de9f32d20abcbf9440b@linux-foundation.org>
On Tue, Jun 30, 2026 at 03:55:17PM -0700, Andrew Morton wrote:
> On Tue, 30 Jun 2026 16:57:43 -0400 Gregory Price <gourry@gourry.net> wrote:
>
> > On Sat, Jun 27, 2026 at 04:10:07PM -0700, Andrew Morton wrote:
> > > On Sat, 27 Jun 2026 16:22:43 -0400 Gregory Price <gourry@gourry.net> wrote:
> > >
> > > > + struct per_cpu_nodestat *p = per_cpu_ptr(pgdat->per_cpu_nodestats, cpu);
> > > >
> > > > - p = per_cpu_ptr(pgdat->per_cpu_nodestats, cpu);
> > > > + for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
> > >
> > > and that's a lot of items.
> > >
> > > I guess the overall loop count won't be large enough to cause issues,
> > > but it's large!
> > >
> > > Perhaps there's some simple test we can do on the per_cpu_nodestat to
> > > avoid the inner loop? Perhaps might need to add a field for this?
> > >
> >
> > I took a look, but that would involve adding another per-cpu field and
> > then making sure all the races on that field are respected as well.
> >
> > Not sure it's worth it for such an extremely rare event.
> >
> > I can try to get clever on the folding logic if you'd like, let me know.
> >
> > > btw, "for(int i..." is allowed nowadays. It'll make this code nicer, IMO.
> > >
> >
> > Otherwise i can send you a respin for this.
>
> Is OK, we could make this change in a million other places.
>
> > > And... Sashiko seems to have found a pre-existing issue:
> > > https://sashiko.dev/#/patchset/20260627202243.758289-1-gourry@gourry.net
> > >
> >
> > Incoming patch for this shortly. Pretty trivial.
>
> Cool, what was the Subject?
>
[PATCH] mm/mm_init: handle alloc_percpu failure in free_area_init_core_hotplug
https://lore.kernel.org/linux-mm/20260630214039.2263562-1-gourry@gourry.net/T/#u
I didn't bother with Cc:stable because it's also 10 years old and
doesn't seem likely to actually get hit, but if you think it should be
stable let me know.
>
> I'll queue this patch in mm-hotfixes for some testing while we await
> further review (please).
>
Thank you!
~Gregory
prev parent reply other threads:[~2026-06-30 23:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-27 20:22 [PATCH v2] mm/vmstat: fold stranded per-cpu node stats when a node comes online Gregory Price
2026-06-27 23:10 ` Andrew Morton
2026-06-28 0:31 ` Gregory Price
2026-06-30 20:57 ` Gregory Price
2026-06-30 22:55 ` Andrew Morton
2026-06-30 23:27 ` Gregory Price [this message]
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=akRQ9KB6-HzLwqwC@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=rppt@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vbabka@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