[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1616046809-6379-1-git-send-email-zhanghongchen@loongson.cn>
Date: Thu, 18 Mar 2021 13:53:29 +0800
From: Hongchen Zhang <zhanghongchen@...ngson.cn>
To: mingo@...hat.com, peterz@...radead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] sched/rt: use DIV_ROUND_UP to calculate sysctl_sched_rr_timeslice
When HZ is 300, the value of sysctl_sched_rr_timeslice is different from
the actual value. Therefore, replace with DIV_ROUND_UP to calculate
sysctl_sched_rr_timeslice.
Signed-off-by: Hongchen Zhang <zhanghongchen@...ngson.cn>
---
kernel/sched/rt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index b980cc96604f..c684440eefdb 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -8,7 +8,7 @@
#include "pelt.h"
int sched_rr_timeslice = RR_TIMESLICE;
-int sysctl_sched_rr_timeslice = (MSEC_PER_SEC / HZ) * RR_TIMESLICE;
+int sysctl_sched_rr_timeslice = DIV_ROUND_UP(RR_TIMESLICE * MSEC_PER_SEC, HZ);
static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun);
--
2.27.0
Powered by blists - more mailing lists