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: <20200814111252.36379-1-tian.xianting@h3c.com>
Date:   Fri, 14 Aug 2020 19:12:52 +0800
From:   Xianting Tian <tian.xianting@....com>
To:     <mingo@...hat.com>, <peterz@...radead.org>,
        <juri.lelli@...hat.com>, <vincent.guittot@...aro.org>,
        <dietmar.eggemann@....com>, <rostedt@...dmis.org>,
        <bsegall@...gle.com>, <mgorman@...e.de>
CC:     <linux-kernel@...r.kernel.org>,
        Xianting Tian <tian.xianting@....com>
Subject: [PATCH] sched: Remove useless settings when 'tg == d->tg'

if 'tg == d->tg' is true, the previous settings for period,runtime
are unnecessary. So move the settings to the 'else' branch.

Signed-off-by: Xianting Tian <tian.xianting@....com>
---
 kernel/sched/rt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index f395ddb75..8b5505735 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2504,12 +2504,12 @@ static int tg_rt_schedulable(struct task_group *tg, void *data)
 	unsigned long total, sum = 0;
 	u64 period, runtime;
 
-	period = ktime_to_ns(tg->rt_bandwidth.rt_period);
-	runtime = tg->rt_bandwidth.rt_runtime;
-
 	if (tg == d->tg) {
 		period = d->rt_period;
 		runtime = d->rt_runtime;
+	} else {
+		period = ktime_to_ns(tg->rt_bandwidth.rt_period);
+		runtime = tg->rt_bandwidth.rt_runtime;
 	}
 
 	/*
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ