Messages in this thread Patch in this message | | | From | Hongchen Zhang <> | Subject | [PATCH] sched/rt: use DIV_ROUND_UP to calculate sysctl_sched_rr_timeslice | Date | Thu, 18 Mar 2021 13:53:29 +0800 |
| |
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@loongson.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
| |