Re: [PATCH 2/2] sched/numa: scan read-only file mappings in tiering mode

From: Gregory Price

Date: Fri Sep 04 2026 - 15:55:01 EST


On Fri, Sep 04, 2026 at 02:20:06PM -0400, Gregory Price wrote:
> @@ -4302,7 +4316,7 @@ static void task_numa_work(struct callback_head *work)
> * 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;
> + vma->numab_state->slow_only = ro_file;
> if (!vma_pids_forced && !vma_is_accessed(mm, vma)) {
> if (!(sysctl_numa_balancing_mode &
> NUMA_BALANCING_MEMORY_TIERING)) {

Sashiko thinks this causes unneeded rescanning, but I don't think it
does. The cursor prevents it from restarting, and when we loop back
around reset_ptenuma_scan() bumps the sequence.

It also had concerns about concurrent scanners and ptl lock contention,
but mm->numa_next_scan only admits one per scan period.

Either way on a rewalk the scan hits pte_protnone() and moves on.

~Gregory