lkml.org 
[lkml]   [2021]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched/rt: use DIV_ROUND_UP to calculate sysctl_sched_rr_timeslice
Date
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
\
 
 \ /
  Last update: 2021-03-18 06:55    [W:1.762 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site