public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] sched/numa: fix bug in update_task_scan_period
@ 2020-08-11  8:30 丁天琛
  2020-08-11 11:01 ` Mel Gorman
  0 siblings, 1 reply; 4+ messages in thread
From: 丁天琛 @ 2020-08-11  8:30 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	linux-kernel
  Cc: 王贇

When p->numa_faults_locality[2] > 0, numa_scan_period is doubled, but
this array will never be cleared, which causes scanning period always
reaching its max value. This patch clears numa_faults_locality after
numa_scan_period being doubled to fix this bug.

Signed-off-by: Tianchen Ding <tianchen.dingtianc@alibaba-inc.com>
Signed-off-by: Michael Wang <yun.wang@linux.alibaba.com>
---
 kernel/sched/fair.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1a68a0536add..a61ee408202e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2180,6 +2180,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.25.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-14 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-11  8:30 [RFC PATCH] sched/numa: fix bug in update_task_scan_period 丁天琛
2020-08-11 11:01 ` Mel Gorman
2020-08-12  3:51   ` 丁天琛
2020-08-14 13:15     ` Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox