[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20230621035847.3349899-1-linmiaohe@huawei.com>
Date: Wed, 21 Jun 2023 11:58:47 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <mingo@...hat.com>, <peterz@...radead.org>,
<juri.lelli@...hat.com>, <vincent.guittot@...aro.org>
CC: <dietmar.eggemann@....com>, <rostedt@...dmis.org>,
<bsegall@...gle.com>, <mgorman@...e.de>, <bristot@...hat.com>,
<vschneid@...hat.com>, <linux-kernel@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH] sched/numa: fix possible uncapped numa_scan_period
The unit of task_scan_max() is ms while ns is expected. This will lead
to task_scan_max() being ineffective.
Fixes: 137844759843 ("sched/numa: Stagger NUMA balancing scan periods for new threads")
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3cc06cfca350..5e90e9658528 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3175,7 +3175,7 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
if (mm) {
unsigned int delay;
- delay = min_t(unsigned int, task_scan_max(current),
+ delay = min_t(unsigned int, task_scan_max(current) * NSEC_PER_MSEC,
current->numa_scan_period * mm_users * NSEC_PER_MSEC);
delay += 2 * TICK_NSEC;
p->node_stamp = delay;
--
2.27.0
Powered by blists - more mailing lists