lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1561599058-11857-1-git-send-email-ran.xiaokai@zte.com.cn>
Date:   Thu, 27 Jun 2019 09:30:58 +0800
From:   Ran Xiaokai <ran.xiaokai@....com.cn>
To:     mingo@...hat.com
Cc:     peterz@...radead.org, linux-kernel@...r.kernel.org,
        wang.yi59@....com.cn, Ran Xiaokai <ran.xiaokai@....com.cn>
Subject: [PATCH] sched/rt: Remove unnecessary (!rt_rq->tg) check

if CONFIG_RT_GROUP_SCHED is configured, every rt_rq belongs to
a certain task_group. Even top rt_rq belongs to root_task_group.
So NULL check in sched_rt_runtime() is unnecessary.

Signed-off-by: Ran Xiaokai <ran.xiaokai@....com.cn>
---
 kernel/sched/rt.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 1e6b909dca36..803e8b86c6f5 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -436,16 +436,13 @@ static inline int on_rt_rq(struct sched_rt_entity *rt_se)
 	return rt_se->on_rq;
 }
 
-#ifdef CONFIG_RT_GROUP_SCHED
-
 static inline u64 sched_rt_runtime(struct rt_rq *rt_rq)
 {
-	if (!rt_rq->tg)
-		return RUNTIME_INF;
-
 	return rt_rq->rt_runtime;
 }
 
+#ifdef CONFIG_RT_GROUP_SCHED
+
 static inline u64 sched_rt_period(struct rt_rq *rt_rq)
 {
 	return ktime_to_ns(rt_rq->tg->rt_bandwidth.rt_period);
@@ -561,11 +558,6 @@ static inline struct rt_bandwidth *sched_rt_bandwidth(struct rt_rq *rt_rq)
 
 #else /* !CONFIG_RT_GROUP_SCHED */
 
-static inline u64 sched_rt_runtime(struct rt_rq *rt_rq)
-{
-	return rt_rq->rt_runtime;
-}
-
 static inline u64 sched_rt_period(struct rt_rq *rt_rq)
 {
 	return ktime_to_ns(def_rt_bandwidth.rt_period);
-- 
2.15.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ