Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp272511pxf; Wed, 17 Mar 2021 22:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv1K0RmZuam6i3OSYJa5A8sLt6mpQQZa55pofrFH4izPyfot/2Kj+Y99JE17n76aJAHPI3 X-Received: by 2002:a17:906:fc1c:: with SMTP id ov28mr39321102ejb.342.1616046922465; Wed, 17 Mar 2021 22:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616046922; cv=none; d=google.com; s=arc-20160816; b=pGmmsVuybJ1twtvQbsOeAXihahxenSd+PWcTJwgYH6V6V0WNa24hzabGi7kJwS3jZO OMsEfoIFAcMU3XM9MiufQMBosGhzz/mjmBDuH9hS7QdpSzLIMrNez9X/1DRvCVe9I9Wm 0VKk/4c4ViGS+HjRuTmVMS8G8NzJlSg8QQ3LvgDnAnvFyUGqAO8l8EA7BzMILsEfw5bb xJIG5FehFnjI5byN3+yUjuEseVzrX+MsmAjWrL73t0VKsgkX8YMmJqgGH0zVnjDO4vtI i7NeLqcwItV6zkh3ozCcelWmdprt5knuo3qBKwzDSsPwrNJRnY89SYEh4dHZ4K3aFTU3 7uXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=P+kzfKSwONA13T6ZDzv1zpT6R45YJWUHeTV5Yzs74yw=; b=dc57BuvvY1e9ytAyvhMfDGIwaR+26ZVH2h3K92z2f2GN3/YXha5XUbJQNklAxbGROu 1ZJ/XZiiLsZMDrsqRCtNwTY2zNSxJBCCSPpK6SAUYektmcOEUL5QXOjvW8hJ5K4LA97l XBkTbuIOEVESWAzxRIjf5qz+faTESLvfkWpjpbezFin0Bf2U3IvdZajfq557MwmcDHDL atGSr+dxpSOPh0rkkegfuT2jLPeOaPE1DkGAp9FyTszd75Y1y9zyMQ0ZZsmtEHR19KoK BcUdOh1cwJxIIyxsYRiyR8ba2ZT8I9ol9eUg+uF8C6IzIWhdGr1WSsHEEISA4i1+6eSu 2K8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si895058ejx.558.2021.03.17.22.54.59; Wed, 17 Mar 2021 22:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbhCRFyC (ORCPT + 99 others); Thu, 18 Mar 2021 01:54:02 -0400 Received: from mail.loongson.cn ([114.242.206.163]:42300 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229454AbhCRFxg (ORCPT ); Thu, 18 Mar 2021 01:53:36 -0400 Received: from localhost.localdomain.localdomain (unknown [10.180.13.87]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Bx4+TZ6lJgXg0CAA--.7221S2; Thu, 18 Mar 2021 13:53:29 +0800 (CST) From: Hongchen Zhang To: mingo@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] sched/rt: use DIV_ROUND_UP to calculate sysctl_sched_rr_timeslice Date: Thu, 18 Mar 2021 13:53:29 +0800 Message-Id: <1616046809-6379-1-git-send-email-zhanghongchen@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Bx4+TZ6lJgXg0CAA--.7221S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Wr1UAFW8KF4xur4UCFyDKFg_yoW3ZFX_u3 saqr1Ykw1qvFyv9FsrAw48ArWagF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eslice is different from the actual value. Therefore, replace with DIV_ROUND_UP to calculate sysctl_sched_rr_timeslice. Signed-off-by: Hongchen Zhang --- 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