Re: [PATCH v4 4/7] sched/numa: separate VMA placement from scan continuation
From: Gregory Price
Date: Thu Oct 01 2026 - 09:48:43 EST
On Thu, Oct 01, 2026 at 12:44:50PM +0200, David Hildenbrand (Arm) wrote:
> On 9/30/26 13:22, Gregory Price wrote:
> > -static bool vma_is_accessed(struct mm_struct *mm, struct vm_area_struct *vma)
> > +static bool vma_needs_placement_scan(struct mm_struct *mm,
> > + struct vm_area_struct *vma)
>
> mm can be had from vma->vm_mm, so likely sufficient to only pass the vma?
>
> Apart from that this looks much clearer to me
>
ack. agreed.
If nothing else comes up on v4, could you please fold the fixlet below?
Otherwise i can spin a v4.
should be conflict-free with a git am -3
~Gregory
--- >8 ---
Subject: sched/numa: drop mm argument from vma_needs_placement_scan()
The mm can be had from vma->vm_mm.
---
kernel/sched/fair.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3b30786ded3b..095289d3da3c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4082,9 +4082,9 @@ static void reset_ptenuma_scan(struct task_struct *p)
p->mm->numa_scan_offset = 0;
}
-static bool vma_needs_placement_scan(struct mm_struct *mm,
- struct vm_area_struct *vma)
+static bool vma_needs_placement_scan(struct vm_area_struct *vma)
{
+ struct mm_struct *mm = vma->vm_mm;
unsigned long pids;
/*
* Allow unconditional access first two times, so that all the (pages)
@@ -4313,7 +4313,7 @@ static void task_numa_work(struct callback_head *work)
* VMA candidate exists. If a scan is already in-progress, finish it,
* but track continuation separately from starting a new one.
*/
- placement_due = vma_needs_placement_scan(mm, vma);
+ placement_due = vma_needs_placement_scan(vma);
scan_started = mm->numa_scan_offset > vma->vm_start;
pid_scan_allowed = vma_pids_forced || placement_due;