Re: [PATCH 2/3] mm/page_alloc: move the kswapd node skip check into a helper
From: SJ Park
Date: Fri Nov 13 2026 - 20:46:15 EST
On Fri, 13 Nov 2026 15:52:35 -0800 Joshua Hahn <joshua.hahnjy@xxxxxxxxx> 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@xxxxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
[...]
> @@ -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
[...]