From: SJ Park <sj@kernel.org>
To: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: SJ Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@kernel.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <brendan.jackman@linux.dev>,
Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
Qi Zheng <qi.zheng@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH 2/3] mm/page_alloc: move the kswapd node skip check into a helper
Date: Fri, 13 Nov 2026 17:45:29 -0800 [thread overview]
Message-ID: <20261114014530.86361-1-sj@kernel.org> (raw)
In-Reply-To: <20261113235238.3595412-3-joshua.hahnjy@gmail.com>
On Fri, 13 Nov 2026 15:52:35 -0800 Joshua Hahn <joshua.hahnjy@gmail.com> wrote:
> get_page_from_freelist() checks many conditions for each zone, often
> with a big comment block explaining the conditions.
>
> Move the kswapd check and its comment into should_skip_kswapd_zone() to
> make the zone iteration cleaner to read.
>
> While moving this, also resolve a checkpatch warning which complains of
> a waitqueue_active() call with no corresponding comment explaining why
> the lockless use is OK in this case.
>
> No functional change intended.
Looks correct to me.
>
> Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Reviewed-by: SJ Park <sj@kernel.org>
[...]
> @@ -3865,22 +3885,10 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
> }
> }
>
> - /*
> - * If kswapd is already active on a node and the zone is below
> - * its kswapd watermark for this request, keep looking for
> - * other nodes that might be idle. This can happen if another
> - * process has NUMA bindings and is causing kswapd wakeups on
> - * only some nodes. Avoid accidental "node_reclaim_mode"-like
> - * behavior in this case.
> - */
> if (skip_kswapd_nodes &&
> - !waitqueue_active(&zone->zone_pgdat->kswapd_wait)) {
> - mark = wmark_pages(zone, kswapd_watermark);
> - if (!zone_watermark_fast(zone, order, mark,
> - ac->highest_zoneidx, 0)) {
> - skipped_kswapd_nodes = true;
> - continue;
> - }
> + should_skip_kswapd_zone(zone, order, ac)) {
> + skipped_kswapd_nodes = true;
> + continue;
Just thinking loud. While reviewing I realized this patch is not based on
mm-new but apparently mm/page_alloc.git for-next. I should also update some of
my setups.
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-11-14 1:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 23:52 [PATCH 0/3] mm/page_alloc, vmscan: get_page_from_freelist cleanups Joshua Hahn
2026-11-13 23:52 ` [PATCH 1/3] mm/page_alloc: drop unused gfp_mask from zone_watermark_fast() Joshua Hahn
2026-11-14 1:17 ` SJ Park
2026-11-13 23:52 ` [PATCH 2/3] mm/page_alloc: move the kswapd node skip check into a helper Joshua Hahn
2026-11-14 1:45 ` SJ Park [this message]
2026-11-13 23:52 ` [PATCH 3/3] mm/vmscan: consolidate promo vs. high watermark checks Joshua Hahn
2026-11-14 1:49 ` SJ Park
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=20261114014530.86361-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brendan.jackman@linux.dev \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=joshua.hahnjy@gmail.com \
--cc=kernel-team@meta.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=qi.zheng@linux.dev \
--cc=rppt@kernel.org \
--cc=shakeel.butt@linux.dev \
--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