From a10cb695acd0a7481b5314d785a59143be2795d7 Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Tue, 24 Aug 2021 10:24:26 -0700 Subject: [PATCH] sched/walt: Improve the scheduler This change is for general scheduler improvement. Change-Id: I42edf6c6df05f0bf72e4c57ee701916860773428 Signed-off-by: Abhijeet Dharmapurikar Signed-off-by: Tengfei Fan Signed-off-by: UtsavBalar1231 --- kernel/sched/boost.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/boost.c b/kernel/sched/boost.c index 96a8899df405..8fd0bde578a9 100644 --- a/kernel/sched/boost.c +++ b/kernel/sched/boost.c @@ -214,12 +214,12 @@ static void sched_boost_enable(int type) static void sched_boost_disable_all(void) { int i; + int prev_boost = sched_boost_type; - for (i = SCHED_BOOST_START; i < SCHED_BOOST_END; i++) { - if (sched_boosts[i].refcount > 0) { - sched_boosts[i].exit(); + if (prev_boost != NO_BOOST) { + sched_boosts[prev_boost].exit(); + for (i = SCHED_BOOST_START; i < SCHED_BOOST_END; i++) sched_boosts[i].refcount = 0; - } } }