From 98d72cd5a23261ab6f948b5407b661b2f350081b Mon Sep 17 00:00:00 2001 From: Lingutla Chandrasekhar Date: Thu, 6 Aug 2020 10:03:00 +0530 Subject: [PATCH] sched: rt: Fix double accounting of cpu util in task placement decision In RT energy aware task placement, cpu utilization is double accounted to check whether cpu would be overutilized for given task or not. Fix the double accounting the cpu util. Change-Id: Id51dd6c952126b870942746c0408fa387ec3bfb1 Signed-off-by: Lingutla Chandrasekhar --- 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 2c62552e60e1..ee9cbb92a660 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1852,11 +1852,11 @@ retry: if (sched_cpu_high_irqload(cpu)) continue; - util = cpu_util(cpu); - - if (__cpu_overutilized(cpu, util + tutil)) + if (__cpu_overutilized(cpu, tutil)) continue; + util = cpu_util(cpu); + /* Find the least loaded CPU */ if (util > best_cpu_util) continue;