From 9847c28cfd7e1dbe4ef99e0ddbb182ce7ebdb9a0 Mon Sep 17 00:00:00 2001 From: Maria Yu Date: Tue, 24 Aug 2021 18:35:07 +0800 Subject: [PATCH] sched/walt: Check if necessary for sched_boost modify Check if necessary to do exit and next_boost enter oprations instead of doing it regardlessly. Core control boost refcounts has been wrong if doing current sched_boost exit and next_boost enter by mistake. Change-Id: Ie40ebf0be0e1b99291d07d160ebef5964d44ba16 Signed-off-by: Maria Yu --- kernel/sched/walt/boost.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/sched/walt/boost.c b/kernel/sched/walt/boost.c index 521933dec5d8..8b6d5f721b26 100644 --- a/kernel/sched/walt/boost.c +++ b/kernel/sched/walt/boost.c @@ -184,17 +184,15 @@ static void sched_boost_disable(int type) if (sb->refcount) return; + next_boost = sched_effective_boost(); + if (next_boost == prev_boost) + return; /* * This boost's refcount becomes zero, so it must * be disabled. Disable it first and then apply * the next boost. */ sb->exit(); - - next_boost = sched_effective_boost(); - if (next_boost == prev_boost) - return; - sched_boosts[next_boost].enter(); }