* [PATCH] sched/numa: Reset NUMA fault locality after scan period update
@ 2026-08-02 11:30 Eric Kim
2026-08-03 7:10 ` Peter Zijlstra
0 siblings, 1 reply; 3+ messages in thread
From: Eric Kim @ 2026-08-02 11:30 UTC (permalink / raw)
To: peterz
Cc: mingo, juri.lelli, vincent.guittot, linux-kernel, Eric Kim,
Binwon Song
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@chungbuk.ac.kr>
Link: https://lore.kernel.org/all/20250404095354.311156-1-qlsdnjs236@chungbuk.ac.kr/
Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>
---
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;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sched/numa: Reset NUMA fault locality after scan period update
2026-08-02 11:30 [PATCH] sched/numa: Reset NUMA fault locality after scan period update Eric Kim
@ 2026-08-03 7:10 ` Peter Zijlstra
2026-08-03 7:47 ` Eric Kim
0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2026-08-03 7:10 UTC (permalink / raw)
To: Eric Kim, Mel Gorman
Cc: mingo, juri.lelli, vincent.guittot, linux-kernel, Binwon Song
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@chungbuk.ac.kr>
> Link: https://lore.kernel.org/all/20250404095354.311156-1-qlsdnjs236@chungbuk.ac.kr/
> Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>
> ---
> 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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] sched/numa: Reset NUMA fault locality after scan period update
2026-08-03 7:10 ` Peter Zijlstra
@ 2026-08-03 7:47 ` Eric Kim
0 siblings, 0 replies; 3+ messages in thread
From: Eric Kim @ 2026-08-03 7:47 UTC (permalink / raw)
To: peterz
Cc: mingo, juri.lelli, vincent.guittot, linux-kernel, Eric Kim,
Binwon Song
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@chungbuk.ac.kr>
Link: https://lore.kernel.org/all/20250404095354.311156-1-qlsdnjs236@chungbuk.ac.kr/
Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>
Changes in v2:
- Share numa_faults_locality reset path with the tail of
update_task_scan_period as suggested by Peter Zijlstra.
---
kernel/sched/fair.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d78467ec6ee13..85d5568669543 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3469,7 +3469,7 @@ static void update_task_scan_period(struct task_struct *p,
p->mm->numa_next_scan = jiffies +
msecs_to_jiffies(p->numa_scan_period);
- return;
+ goto out;
}
/*
@@ -3513,7 +3513,10 @@ static void update_task_scan_period(struct task_struct *p,
p->numa_scan_period = clamp(p->numa_scan_period + diff,
task_scan_min(p), task_scan_max(p));
- memset(p->numa_faults_locality, 0, sizeof(p->numa_faults_locality));
+
+out:
+ memset(p->numa_faults_locality, 0,
+ sizeof(p->numa_faults_locality));
}
/*
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-03 7:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 11:30 [PATCH] sched/numa: Reset NUMA fault locality after scan period update Eric Kim
2026-08-03 7:10 ` Peter Zijlstra
2026-08-03 7:47 ` Eric Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox