Messages in this thread Patch in this message | | | From | Xianting Tian <> | Subject | [PATCH] sched: Remove useless settings when 'tg == d->tg' | Date | Fri, 14 Aug 2020 19:12:52 +0800 |
| |
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@h3c.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
| |