Re: [PATCH] sched/numa: Reset NUMA fault locality after scan period update

From: Peter Zijlstra

Date: Mon Aug 03 2026 - 03:15:23 EST


On Sun, Aug 02, 2026 at 08:30:18PM +0900, Eric Kim wrote:
> When updating the task scan period for NUMA locality checks,
> update_task_scan_period should increase the scan periods
> either when there were no faults or when there is a failed migration
> attempt. However, numa_faults_locality which is used to check for
> migration failure and number of faults is not cleared when it is in
> this state, causing stale migration and fault information to affect
> later decisions.
>
> clear numa_faults_locality after updating the scan period so that
> at each update it uses newly collected information.
>
> Reported-by: Binwon Song <qlsdnjs236@xxxxxxxxxxxxxx>
> Link: https://lore.kernel.org/all/20250404095354.311156-1-qlsdnjs236@xxxxxxxxxxxxxx/
> Signed-off-by: Eric Kim <seohyun.kim@xxxxxxxxxx>
> ---
> kernel/sched/fair.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index d78467ec6ee13..2ac1ef9ad63bd 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3469,6 +3469,8 @@ static void update_task_scan_period(struct task_struct *p,
> p->mm->numa_next_scan = jiffies +
> msecs_to_jiffies(p->numa_scan_period);
>
> + memset(p->numa_faults_locality, 0,
> + sizeof(p->numa_faults_locality));
> return;
> }

Can/should we share core with the tail of this function?