From: Gregory Price <gourry@gourry.net>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, akpm@linux-foundation.org,
vbabka@kernel.org, surenb@google.com, mhocko@suse.com,
brendan.jackman@linux.dev, ziy@nvidia.com, flyinrm@gmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc: let the highest memory node recover from hopeless state
Date: Mon, 19 Oct 2026 16:40:05 -0400 [thread overview]
Message-ID: <atZ8ej_zL-D_FIIt@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20261019201321.GJ371161@cmpxchg.org>
On Mon, Oct 19, 2026 at 10:13:21PM +0200, Johannes Weiner wrote:
> On Mon, Oct 19, 2026 at 02:48:50PM -0400, Gregory Price (Meta) wrote:
> > free_frozen_page_commit() clears a hopeless node's kswapd failures once
> > its zone recovers above the high watermark, but only if another memory
> > node exists for allocations to fall back to.
> >
> > The test `next_memory_node(nid) < MAX_NUMNODES` finds only memory nodes
> > with a higher id. The highest-numbered memory node therefore never
> > recovers on this path, and its kswapd stays disabled until reclaim on
> > that node makes progress and balances it, or demotion is re-enabled.
>
> This seems to be the express goal in the commit referenced by
> Fixes:. Can you explain why this premise was wrong?
>
tl;dr: next_memory_node() is not the right check for what the
comment and patches say it actually wants to check.
on a 2-socket system you would have:
if (next_memory_node(0) < MAX_NUMNODES) /* clear's hopeless */
if (next_memory_node(1) < MAX_NUMNODES) /* doesn't clear hopeless */
despite the fact that each node is the other one's fallback node.
> The patch in question also only added another re-wake event. It didn't
> remove one. How can it be at fault for kswapd getting stuck?
Not at fault for getting stuck - it didn't fully fix the thing it claimed
to fix. So this patch completes that patch's attempt.
> I don't understand what "having more than one node in the system"
> means for re-igniting kswapd on this one node.
>
> Generally I don't understand what the heck we're trying to do with all
> these patches against the hopeless state code. It shouldn't be that
> hard, right?? If kswapd on a node failed for whatever reason, let it
> sleep until direct reclaim makes forward progress, or other frees
> (unmap, etc.) put the node back above the high watermarks (which means
> enough of the unreclaimable pages were freed to justify a new wakeup
> in the future to attempt reclaim against new pages).
>
Zi said the same thing, and I agree.
I didn't want to propose that in a stable tagged commit, but if there's
strong opinions here I can just outright drop it.
~Gregory
prev parent reply other threads:[~2026-10-19 20:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 18:48 Gregory Price (Meta)
2026-10-19 19:51 ` Zi Yan
2026-10-19 20:16 ` Gregory Price
2026-10-19 20:13 ` Johannes Weiner
2026-10-19 20:40 ` 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=atZ8ej_zL-D_FIIt@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=akpm@linux-foundation.org \
--cc=brendan.jackman@linux.dev \
--cc=flyinrm@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=stable@vger.kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/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
all inboxes | Powered by JetHome®