From: Joshua Hahn <joshua.hahnjy@gmail.com>
To: "Gregory Price (Meta)" <gourry@gourry.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
"Lorenzo Stoakes (ARM)" <ljs@kernel.org>,
Vlastimil Babka <vbabka@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <brendan.jackman@linux.dev>,
Zi Yan <ziy@nvidia.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH v2] mm/page_alloc: only skip kswapd nodes below their kswapd watermark
Date: Thu, 12 Nov 2026 10:52:54 -0800 [thread overview]
Message-ID: <avYKuUJJNFylInRP@devbig011.atn3.facebook.com> (raw)
In-Reply-To: <179446431092.482102.12227242887844422381.b4-reply@b4>
On Thu, Nov 12, 2026 at 01:18:30AM -0500, Gregory Price (Meta) wrote:
> On 2026-11-10 14:44 -0800, Joshua Hahn wrote:
> > Commit 19c5fb83f2a4 ("mm: page_alloc: avoid kswapd thrashing due to
> > NUMA restrictions") makes get_page_from_freelist() skip any node with an
> > active kswapd on the first pass through the zonelist, so unrestricted
> > allocations don't immediately consume the memory kswapd is freeing.
> >
> > But kswapd is also woken for high-order requests. With THP defrag set to
> > defer, each THP fault that fails on a fragmented node wakes kswapd at
> > PMD order. kswapd reclaims a batch, wakes kcompactd, and sleeps until
> > the next failed fault, so it stays awake much of the time even on a node
> > with plenty of free order-0 memory. This means those order-0 allocations
> > get directed elsewhere.
> >
> > This was observed on some Meta production workloads running on 2-NUMA
> > systems, where processes with a preference for node0 allocations
> > continuously allocated order-0 pages on node1, despite node0 having
> > hundreds of GB of free memory.
> >
> > Only skip a zone with an active kswapd if it is also below kswapd's
> > target watermark.
> >
>
> I feel this commit message could have been simplified further.
> Brevity is the soul of wit.
>
> patch (details) skips any node with kswapd running - assuming that
> this means memory is low, but kswapd is woken for other reasons (e.g.
> order-N allocation failures).
>
> This results in fallback allocations under X conditions, which leads
> to xyz performance isues.
>
> Only skip nodes with kswap running if the node is under the relevant
> low-memory watermark.
>
> (test details)
Thanks Gregory,
I was going to ask to have the commit message updated as a fixlet but
I think given the amount of change going in I will just send a new
version with a more concise commit message to make it less confusing.
Thanks again, have a great day!
Joshua
> Otherwise this looks good to me. Looking forward to the watermark
> cleanup afterwards - i agree the change here is a bit ugly, but
> probably preferable for the backport.
>
> Acked-by: Gregory Price (Meta) <gourry@gourry.net>
>
> --
> ~Gregory
>
next prev parent reply other threads:[~2026-11-12 18:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 22:44 [PATCH v2] mm/page_alloc: only skip kswapd nodes below their kswapd watermark Joshua Hahn
2026-11-11 17:39 ` Jose A. Perez de Azpillaga
2026-11-12 6:18 ` Gregory Price (Meta)
2026-11-12 18:52 ` Joshua Hahn [this message]
2026-11-12 16:22 ` Zi Yan
2026-11-12 16:37 ` Johannes Weiner
2026-11-12 19:55 ` Lorenzo Stoakes (ARM)
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=avYKuUJJNFylInRP@devbig011.atn3.facebook.com \
--to=joshua.hahnjy@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=brendan.jackman@linux.dev \
--cc=gourry@gourry.net \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--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