* [PATCH v3 0/2] mm/page_alloc: get_page_from_freelist cleanups @ 2026-11-18 23:05 Joshua Hahn 2026-11-18 23:05 ` [PATCH v3 1/2] mm/page_alloc: move the kswapd node skip check into a helper Joshua Hahn 2026-11-18 23:05 ` [PATCH v3 2/2] mm/vmscan: consolidate promo vs. high watermark checks Joshua Hahn 0 siblings, 2 replies; 5+ messages in thread From: Joshua Hahn @ 2026-11-18 23:05 UTC (permalink / raw) To: Andrew Morton, Vlastimil Babka, David Hildenbrand Cc: Lorenzo Stoakes, Liam R. Howlett, Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Johannes Weiner, Zi Yan, Qi Zheng, Shakeel Butt, Dev Jain, linux-mm, linux-kernel, kernel-team v2 --> v3: ========== - Drop 1/3, since Kiryl is working on some in-flight changes that use the gfp mask. Thank you Dev Jain for pointing this out. - Mark should_skip_kswapd_zone as inline, as suggested by Dev Jain. - Collect signatures. 2 cleanups for vmscan and page_alloc code. The primary goal is to make get_page_from_freelist a bit easier to read, especially after the new kswapd zone skip conditions [1]. Based on the latest page_alloc/for-next branch as of 11/18/2026. Notably, there is a dependency on the aforementioned kswapd zone skip, 677dfdfad244a "mm/page_alloc: only skip kswapd nodes below their kswapd watermark". No functional changes intended. [1] https://lore.kernel.org/all/CAN+CAwNsqWpPoag_XE6bxbrfi6m71xw1NS_wc3h_ShZjNspSjg@mail.gmail.com/ Joshua Hahn (2): mm/page_alloc: move the kswapd node skip check into a helper mm/vmscan: consolidate promo vs. high watermark checks mm/internal.h | 1 + mm/page_alloc.c | 47 ++++++++++++++++++++++++++++------------------- mm/vmscan.c | 22 +++++++++++++--------- 3 files changed, 42 insertions(+), 28 deletions(-) base-commit: 3a99594e62fce8c646e8aac01d38af16d6833a40 -- 2.53.1-Meta ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/2] mm/page_alloc: move the kswapd node skip check into a helper 2026-11-18 23:05 [PATCH v3 0/2] mm/page_alloc: get_page_from_freelist cleanups Joshua Hahn @ 2026-11-18 23:05 ` Joshua Hahn 2026-11-18 23:05 ` [PATCH v3 2/2] mm/vmscan: consolidate promo vs. high watermark checks Joshua Hahn 1 sibling, 0 replies; 5+ messages in thread From: Joshua Hahn @ 2026-11-18 23:05 UTC (permalink / raw) To: Andrew Morton, Vlastimil Babka, David Hildenbrand Cc: Lorenzo Stoakes, Liam R. Howlett, Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Johannes Weiner, Zi Yan, Qi Zheng, Shakeel Butt, Dev Jain, linux-mm, linux-kernel, kernel-team 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. Reviewed-by: SJ Park <sj@kernel.org> Reviewed-by: Chris Down <chris@chrisdown.name> Reviewed-by: Zi Yan <ziy@nvidia.com> Reviewed-by: Gregory Price <gourry@gourry.net> Reviewed-by: Dev Jain <dev.jain@arm.com> Tested-by: Chris Down <chris@chrisdown.name> Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com> --- mm/page_alloc.c | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9e1261521b6a3..e7a7863e381ab 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3785,6 +3785,34 @@ static inline unsigned int alloc_flags_cma(gfp_t gfp_mask) return ALLOC_DEFAULT; } +/* + * 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. + */ +static inline bool +should_skip_kswapd_zone(struct zone *zone, unsigned int order, + const struct alloc_context *ac, gfp_t gfp_mask) +{ + unsigned long mark; + + /* + * This means kswapd is asleep, so don't skip the zone. This is a + * lockless check, since a stale result only affects zone selection. + */ + if (waitqueue_active(&zone->zone_pgdat->kswapd_wait)) + return false; + + if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) + mark = promo_wmark_pages(zone); + else + mark = high_wmark_pages(zone); + return !zone_watermark_fast(zone, order, mark, ac->highest_zoneidx, + 0, gfp_mask); +} + /* * get_page_from_freelist goes through the zonelist trying to allocate * a page. @@ -3796,9 +3824,6 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, struct zoneref *z; struct zone *zone; struct pglist_data *last_pgdat = NULL; - enum zone_watermarks kswapd_watermark = - sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING ? - WMARK_PROMO : WMARK_HIGH; bool last_pgdat_dirty_ok = false; bool no_fallback; bool skip_kswapd_nodes = nr_online_nodes > 1; @@ -3865,22 +3890,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, gfp_mask)) { - skipped_kswapd_nodes = true; - continue; - } + should_skip_kswapd_zone(zone, order, ac, gfp_mask)) { + skipped_kswapd_nodes = true; + continue; } cond_accept_memory(zone, order, alloc_flags); -- 2.53.1-Meta ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 2/2] mm/vmscan: consolidate promo vs. high watermark checks 2026-11-18 23:05 [PATCH v3 0/2] mm/page_alloc: get_page_from_freelist cleanups Joshua Hahn 2026-11-18 23:05 ` [PATCH v3 1/2] mm/page_alloc: move the kswapd node skip check into a helper Joshua Hahn @ 2026-11-18 23:05 ` Joshua Hahn 2026-11-23 13:44 ` Vlastimil Babka (SUSE) 1 sibling, 1 reply; 5+ messages in thread From: Joshua Hahn @ 2026-11-18 23:05 UTC (permalink / raw) To: Andrew Morton, Vlastimil Babka, David Hildenbrand Cc: Lorenzo Stoakes, Liam R. Howlett, Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Johannes Weiner, Zi Yan, Qi Zheng, Shakeel Butt, Dev Jain, linux-mm, linux-kernel, kernel-team There are three sites which all check the watermark that kswapd reclaims zones up to, which is the promo watermark when NUMA balancing memory tiering is enabled, and the high watermark otherwise. Consolidate the pattern into a helper function. While at it, remove the include for <linux/sched/sysctl.h> in mm/page_alloc.c now that the dependency on sysctl_numa_balancing_mode has been abstracted into vmscan code. No functional changes intended. Reviewed-by: SJ Park <sj@kernel.org> Reviewed-by: Chris Down <chris@chrisdown.name> Reviewed-by: Zi Yan <ziy@nvidia.com> Reviewed-by: Gregory Price <gourry@gourry.net> Reviewed-by: Dev Jain <dev.jain@arm.com> Tested-by: Chris Down <chris@chrisdown.name> Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com> --- mm/internal.h | 1 + mm/page_alloc.c | 6 +----- mm/vmscan.c | 22 +++++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 566cbd2dce485..8beb5b263ca1f 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -68,6 +68,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order, gfp_t gfp_mask, const nodemask_t *mask); unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone_idx); +unsigned long kswapd_wmark_pages(const struct zone *zone); #define MEMCG_RECLAIM_MAY_SWAP (1 << 1) #define MEMCG_RECLAIM_PROACTIVE (1 << 2) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e7a7863e381ab..31a670eb4832c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -45,7 +45,6 @@ #include <linux/mmu_notifier.h> #include <linux/migrate.h> #include <linux/sched/mm.h> -#include <linux/sched/sysctl.h> #include <linux/page_owner.h> #include <linux/page_table_check.h> #include <linux/memcontrol.h> @@ -3805,10 +3804,7 @@ should_skip_kswapd_zone(struct zone *zone, unsigned int order, if (waitqueue_active(&zone->zone_pgdat->kswapd_wait)) return false; - if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) - mark = promo_wmark_pages(zone); - else - mark = high_wmark_pages(zone); + mark = kswapd_wmark_pages(zone); return !zone_watermark_fast(zone, order, mark, ac->highest_zoneidx, 0, gfp_mask); } diff --git a/mm/vmscan.c b/mm/vmscan.c index 9959ca158ce83..9af50783fc824 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -478,6 +478,17 @@ unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone return size; } +/* + * The watermark kswapd reclaims zones up to. With NUMA balancing memory + * tiering, kswapd keeps room above the high watermark for promotions. + */ +unsigned long kswapd_wmark_pages(const struct zone *zone) +{ + if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) + return promo_wmark_pages(zone); + return high_wmark_pages(zone); +} + static unsigned long drop_slab_node(int nid) { unsigned long freed = 0; @@ -5212,7 +5223,6 @@ static long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc) { int i; - enum zone_watermarks mark; if (unlikely(sc->proactive && signal_pending(current))) return true; @@ -5224,12 +5234,9 @@ static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc) if (!current_is_kswapd() || sc->order) return false; - mark = sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING ? - WMARK_PROMO : WMARK_HIGH; - for (i = 0; i <= sc->reclaim_idx; i++) { struct zone *zone = lruvec_pgdat(lruvec)->node_zones + i; - unsigned long size = wmark_pages(zone, mark) + MIN_LRU_BATCH; + unsigned long size = kswapd_wmark_pages(zone) + MIN_LRU_BATCH; if (managed_zone(zone) && !zone_watermark_ok(zone, 0, size, sc->reclaim_idx, 0)) return false; @@ -7131,10 +7138,7 @@ static bool pgdat_balanced(pg_data_t *pgdat, int order, int highest_zoneidx) enum zone_stat_item item; unsigned long free_pages; - if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) - mark = promo_wmark_pages(zone); - else - mark = high_wmark_pages(zone); + mark = kswapd_wmark_pages(zone); /* * In defrag_mode, watermarks must be met in whole -- 2.53.1-Meta ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] mm/vmscan: consolidate promo vs. high watermark checks 2026-11-18 23:05 ` [PATCH v3 2/2] mm/vmscan: consolidate promo vs. high watermark checks Joshua Hahn @ 2026-11-23 13:44 ` Vlastimil Babka (SUSE) 2026-11-23 17:49 ` Joshua Hahn 0 siblings, 1 reply; 5+ messages in thread From: Vlastimil Babka (SUSE) @ 2026-11-23 13:44 UTC (permalink / raw) To: Joshua Hahn, Andrew Morton, David Hildenbrand Cc: Lorenzo Stoakes, Liam R. Howlett, Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Johannes Weiner, Zi Yan, Qi Zheng, Shakeel Butt, Dev Jain, linux-mm, linux-kernel, kernel-team On 11/19/26 00:05, Joshua Hahn wrote: > There are three sites which all check the watermark that kswapd reclaims > zones up to, which is the promo watermark when NUMA balancing memory > tiering is enabled, and the high watermark otherwise. > > Consolidate the pattern into a helper function. While at it, remove the > include for <linux/sched/sysctl.h> in mm/page_alloc.c now that the > dependency on sysctl_numa_balancing_mode has been abstracted into > vmscan code. > > No functional changes intended. > > Reviewed-by: SJ Park <sj@kernel.org> > Reviewed-by: Chris Down <chris@chrisdown.name> > Reviewed-by: Zi Yan <ziy@nvidia.com> > Reviewed-by: Gregory Price <gourry@gourry.net> > Reviewed-by: Dev Jain <dev.jain@arm.com> > Tested-by: Chris Down <chris@chrisdown.name> > Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com> > --- > mm/internal.h | 1 + > mm/page_alloc.c | 6 +----- > mm/vmscan.c | 22 +++++++++++++--------- > 3 files changed, 15 insertions(+), 14 deletions(-) > > diff --git a/mm/internal.h b/mm/internal.h > index 566cbd2dce485..8beb5b263ca1f 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -68,6 +68,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order, > gfp_t gfp_mask, const nodemask_t *mask); > unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, > int zone_idx); > +unsigned long kswapd_wmark_pages(const struct zone *zone); Can we inline it? Seems wasteful to make the allocation fastpath call to vmscan.o just for this. I'd probably put it in mm/page_alloc.h as we're trying to split out the monolithing mm/internal.h It shouldn't be a problem to include include/linux/sched/sysctl.h there for sysctl_numa_balancing_mode, hopefully. Thanks. > > #define MEMCG_RECLAIM_MAY_SWAP (1 << 1) > #define MEMCG_RECLAIM_PROACTIVE (1 << 2) > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index e7a7863e381ab..31a670eb4832c 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -45,7 +45,6 @@ > #include <linux/mmu_notifier.h> > #include <linux/migrate.h> > #include <linux/sched/mm.h> > -#include <linux/sched/sysctl.h> > #include <linux/page_owner.h> > #include <linux/page_table_check.h> > #include <linux/memcontrol.h> > @@ -3805,10 +3804,7 @@ should_skip_kswapd_zone(struct zone *zone, unsigned int order, > if (waitqueue_active(&zone->zone_pgdat->kswapd_wait)) > return false; > > - if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > - mark = promo_wmark_pages(zone); > - else > - mark = high_wmark_pages(zone); > + mark = kswapd_wmark_pages(zone); > return !zone_watermark_fast(zone, order, mark, ac->highest_zoneidx, > 0, gfp_mask); > } > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 9959ca158ce83..9af50783fc824 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -478,6 +478,17 @@ unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone > return size; > } > > +/* > + * The watermark kswapd reclaims zones up to. With NUMA balancing memory > + * tiering, kswapd keeps room above the high watermark for promotions. > + */ > +unsigned long kswapd_wmark_pages(const struct zone *zone) > +{ > + if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > + return promo_wmark_pages(zone); > + return high_wmark_pages(zone); > +} > + > static unsigned long drop_slab_node(int nid) > { > unsigned long freed = 0; > @@ -5212,7 +5223,6 @@ static long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, > static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc) > { > int i; > - enum zone_watermarks mark; > > if (unlikely(sc->proactive && signal_pending(current))) > return true; > @@ -5224,12 +5234,9 @@ static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc) > if (!current_is_kswapd() || sc->order) > return false; > > - mark = sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING ? > - WMARK_PROMO : WMARK_HIGH; > - > for (i = 0; i <= sc->reclaim_idx; i++) { > struct zone *zone = lruvec_pgdat(lruvec)->node_zones + i; > - unsigned long size = wmark_pages(zone, mark) + MIN_LRU_BATCH; > + unsigned long size = kswapd_wmark_pages(zone) + MIN_LRU_BATCH; > > if (managed_zone(zone) && !zone_watermark_ok(zone, 0, size, sc->reclaim_idx, 0)) > return false; > @@ -7131,10 +7138,7 @@ static bool pgdat_balanced(pg_data_t *pgdat, int order, int highest_zoneidx) > enum zone_stat_item item; > unsigned long free_pages; > > - if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > - mark = promo_wmark_pages(zone); > - else > - mark = high_wmark_pages(zone); > + mark = kswapd_wmark_pages(zone); > > /* > * In defrag_mode, watermarks must be met in whole ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] mm/vmscan: consolidate promo vs. high watermark checks 2026-11-23 13:44 ` Vlastimil Babka (SUSE) @ 2026-11-23 17:49 ` Joshua Hahn 0 siblings, 0 replies; 5+ messages in thread From: Joshua Hahn @ 2026-11-23 17:49 UTC (permalink / raw) To: Vlastimil Babka (SUSE) Cc: Andrew Morton, David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett, Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Johannes Weiner, Zi Yan, Qi Zheng, Shakeel Butt, Dev Jain, linux-mm, linux-kernel, kernel-team On Mon, Nov 23, 2026 at 02:44:31PM +0100, Vlastimil Babka (SUSE) wrote: > On 11/19/26 00:05, Joshua Hahn wrote: > > There are three sites which all check the watermark that kswapd reclaims > > zones up to, which is the promo watermark when NUMA balancing memory > > tiering is enabled, and the high watermark otherwise. > > > > Consolidate the pattern into a helper function. While at it, remove the > > include for <linux/sched/sysctl.h> in mm/page_alloc.c now that the > > dependency on sysctl_numa_balancing_mode has been abstracted into > > vmscan code. > > > > No functional changes intended. > > > > Reviewed-by: SJ Park <sj@kernel.org> > > Reviewed-by: Chris Down <chris@chrisdown.name> > > Reviewed-by: Zi Yan <ziy@nvidia.com> > > Reviewed-by: Gregory Price <gourry@gourry.net> > > Reviewed-by: Dev Jain <dev.jain@arm.com> > > Tested-by: Chris Down <chris@chrisdown.name> > > Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com> > > --- > > mm/internal.h | 1 + > > mm/page_alloc.c | 6 +----- > > mm/vmscan.c | 22 +++++++++++++--------- > > 3 files changed, 15 insertions(+), 14 deletions(-) > > > > diff --git a/mm/internal.h b/mm/internal.h > > index 566cbd2dce485..8beb5b263ca1f 100644 > > --- a/mm/internal.h > > +++ b/mm/internal.h > > @@ -68,6 +68,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order, > > gfp_t gfp_mask, const nodemask_t *mask); > > unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, > > int zone_idx); > > +unsigned long kswapd_wmark_pages(const struct zone *zone); > > Can we inline it? Seems wasteful to make the allocation fastpath call to > vmscan.o just for this. Hi Vlastimil, thanks for taking a look! Yeah, sounds reasonable to me. > I'd probably put it in mm/page_alloc.h as we're trying to split out the > monolithing mm/internal.h > It shouldn't be a problem to include include/linux/sched/sysctl.h there for > sysctl_numa_balancing_mode, hopefully. Doesn't seem like it will be an issue. Let me send out a new version for this with both changes then. Have a great day! Joshua > Thanks. > > > > > #define MEMCG_RECLAIM_MAY_SWAP (1 << 1) > > #define MEMCG_RECLAIM_PROACTIVE (1 << 2) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index e7a7863e381ab..31a670eb4832c 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -45,7 +45,6 @@ > > #include <linux/mmu_notifier.h> > > #include <linux/migrate.h> > > #include <linux/sched/mm.h> > > -#include <linux/sched/sysctl.h> > > #include <linux/page_owner.h> > > #include <linux/page_table_check.h> > > #include <linux/memcontrol.h> > > @@ -3805,10 +3804,7 @@ should_skip_kswapd_zone(struct zone *zone, unsigned int order, > > if (waitqueue_active(&zone->zone_pgdat->kswapd_wait)) > > return false; > > > > - if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > > - mark = promo_wmark_pages(zone); > > - else > > - mark = high_wmark_pages(zone); > > + mark = kswapd_wmark_pages(zone); > > return !zone_watermark_fast(zone, order, mark, ac->highest_zoneidx, > > 0, gfp_mask); > > } > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > index 9959ca158ce83..9af50783fc824 100644 > > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -478,6 +478,17 @@ unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone > > return size; > > } > > > > +/* > > + * The watermark kswapd reclaims zones up to. With NUMA balancing memory > > + * tiering, kswapd keeps room above the high watermark for promotions. > > + */ > > +unsigned long kswapd_wmark_pages(const struct zone *zone) > > +{ > > + if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > > + return promo_wmark_pages(zone); > > + return high_wmark_pages(zone); > > +} > > + > > static unsigned long drop_slab_node(int nid) > > { > > unsigned long freed = 0; > > @@ -5212,7 +5223,6 @@ static long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, > > static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc) > > { > > int i; > > - enum zone_watermarks mark; > > > > if (unlikely(sc->proactive && signal_pending(current))) > > return true; > > @@ -5224,12 +5234,9 @@ static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc) > > if (!current_is_kswapd() || sc->order) > > return false; > > > > - mark = sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING ? > > - WMARK_PROMO : WMARK_HIGH; > > - > > for (i = 0; i <= sc->reclaim_idx; i++) { > > struct zone *zone = lruvec_pgdat(lruvec)->node_zones + i; > > - unsigned long size = wmark_pages(zone, mark) + MIN_LRU_BATCH; > > + unsigned long size = kswapd_wmark_pages(zone) + MIN_LRU_BATCH; > > > > if (managed_zone(zone) && !zone_watermark_ok(zone, 0, size, sc->reclaim_idx, 0)) > > return false; > > @@ -7131,10 +7138,7 @@ static bool pgdat_balanced(pg_data_t *pgdat, int order, int highest_zoneidx) > > enum zone_stat_item item; > > unsigned long free_pages; > > > > - if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > > - mark = promo_wmark_pages(zone); > > - else > > - mark = high_wmark_pages(zone); > > + mark = kswapd_wmark_pages(zone); > > > > /* > > * In defrag_mode, watermarks must be met in whole > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-23 17:49 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-11-18 23:05 [PATCH v3 0/2] mm/page_alloc: get_page_from_freelist cleanups Joshua Hahn 2026-11-18 23:05 ` [PATCH v3 1/2] mm/page_alloc: move the kswapd node skip check into a helper Joshua Hahn 2026-11-18 23:05 ` [PATCH v3 2/2] mm/vmscan: consolidate promo vs. high watermark checks Joshua Hahn 2026-11-23 13:44 ` Vlastimil Babka (SUSE) 2026-11-23 17:49 ` Joshua Hahn
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®