Re: [PATCH 1/2] sched/numa: do not let the per-VMA PID filter gate promotion

From: Gregory Price

Date: Fri Sep 04 2026 - 15:11:35 EST


> /*
> * Do not scan the VMA if task has not accessed it, unless no other
> * VMA candidate exists.
> + *
> + * Force-scan only slow-tier folios when in tiering mode, as a large
> + * VMA can cause others to become "permanently unaccessed" if a scan
> + * cycle is consumed entirely by the large VMA.
> */
> + vma->numab_state->slow_only = false;
> if (!vma_pids_forced && !vma_is_accessed(mm, vma)) {
> - vma_pids_skipped = true;
> - trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_PID_INACTIVE);
> - continue;
> + if (!(sysctl_numa_balancing_mode &
> + NUMA_BALANCING_MEMORY_TIERING)) {
> + vma_pids_skipped = true;
> + trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_PID_INACTIVE);
> + continue;
> + }
> + vma->numab_state->slow_only = true;
> }

sashiko (correctly) reported that slow_only=false set unconditionally
here causes a VMA that's scanned over two passes to be prematurely
re-admitted regardless of vma_is_accessed() activity.

Patch looks simple:

+ if (mm->numa_scan_offset <= vma->vm_start)
+ vma->numab_state->slow_only = false;

and on patch two:

- vma->numab_state->slow_only = false;
+ vma->numab_state->slow_only = ro_file;

I'll follow up with a v2 next week after I test it.

~Gregory