From ca8c9368b6f28ef625716b03aa930acfb8afe158 Mon Sep 17 00:00:00 2001 From: Christian Loehle Date: Thu, 5 Sep 2024 10:26:40 +0100 Subject: TEST: cpufreq/schedutil: Linear iowait boost step In preparation for capping iowait boost make the steps linear as opposed to doubling. Signed-off-by: Christian Loehle --- kernel/sched/cpufreq_schedutil.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -267,7 +267,8 @@ static void sugov_iowait_boost(struct su /* Double the boost at each request */ if (sg_cpu->iowait_boost) { sg_cpu->iowait_boost = - min_t(unsigned int, sg_cpu->iowait_boost << 1, SCHED_CAPACITY_SCALE); + min_t(unsigned int, + sg_cpu->iowait_boost + IOWAIT_BOOST_MIN, SCHED_CAPACITY_SCALE); return; } @@ -308,11 +309,9 @@ static unsigned long sugov_iowait_apply( /* * No boost pending; reduce the boost value. */ - sg_cpu->iowait_boost >>= 1; - if (sg_cpu->iowait_boost < IOWAIT_BOOST_MIN) { - sg_cpu->iowait_boost = 0; + sg_cpu->iowait_boost -= IOWAIT_BOOST_MIN; + if (!sg_cpu->iowait_boost) return 0; - } } sg_cpu->iowait_boost_pending = false;