Re: [PATCH v2 1/4] mm: support promotion-only NUMA hinting scans

From: Peter Zijlstra

Date: Thu Sep 17 2026 - 12:41:53 EST


On Thu, Sep 10, 2026 at 08:18:23PM -0400, Gregory Price wrote:

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 8dff37059faf..81359b414947 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4129,8 +4129,10 @@ static void task_numa_work(struct callback_head *work)
> unsigned long nr_pte_updates = 0;
> long pages, virtpages;
> struct vma_iterator vmi;
> + unsigned int numab_mode = READ_ONCE(sysctl_numa_balancing_mode);

This thing sticks out like a sort thumb, does that want to be on top?
Typically reverse xmas is preferred and all that.

> bool vma_pids_skipped;
> bool vma_pids_forced = false;
> + bool promo_only;
>
> WARN_ON_ONCE(p != container_of(work, struct task_struct, numa_work));
>

> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1237,11 +1237,12 @@ static inline bool vma_is_single_threaded_private(struct vm_area_struct *vma)
>
> #ifdef CONFIG_NUMA_BALANCING
> bool folio_can_map_prot_numa(struct folio *folio, struct vm_area_struct *vma,
> - bool is_private_single_threaded);
> + bool is_private_single_threaded, bool promo_only);

Two bools rather than updating the existing bool to a flags?