From 36e8ad7ae8fa946baecfe97dd2f2119caea59895 Mon Sep 17 00:00:00 2001 From: Alexander Winkowski Date: Tue, 23 Aug 2022 10:14:47 +0000 Subject: [PATCH] cpufreq: schedutil: Give explicit hints to compiler Make sure the compiler optimises away conditions that are always false since commit b91319892e5cfd7e6a506ce4b7117ffed5d6de06 (cpufreq: schedutil: Don't jump to max frequency for RT tasks). Change-Id: I7a108ff1a4ba09f2cb82ea8a82bd15967e724709 Signed-off-by: Alexander Winkowski --- kernel/sched/cpufreq_schedutil.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 43acc961c850..366ac2d783ed 100755 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -326,7 +326,6 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, if (flags & SCHED_CPUFREQ_PL) return; - flags &= ~SCHED_CPUFREQ_RT_DL; sugov_set_iowait_boost(sg_cpu, time, flags); sg_cpu->last_update = time; @@ -335,7 +334,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, busy = use_pelt() && sugov_cpu_is_busy(sg_cpu); - if (flags & SCHED_CPUFREQ_RT_DL) { + if (0) { sg_policy->cached_raw_freq = sg_policy->prev_cached_raw_freq; next_f = policy->cpuinfo.max_freq; } else { @@ -383,7 +382,7 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time) j_sg_cpu->iowait_boost_pending = false; continue; } - if (j_sg_cpu->flags & SCHED_CPUFREQ_RT_DL) { + if (0) { sg_policy->cached_raw_freq = sg_policy->prev_cached_raw_freq; return policy->cpuinfo.max_freq; } @@ -414,8 +413,6 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, sugov_get_util(&util, &max, sg_cpu->cpu); - flags &= ~SCHED_CPUFREQ_RT_DL; - raw_spin_lock(&sg_policy->update_lock); sg_cpu->util = util; @@ -427,7 +424,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, if (sugov_should_update_freq(sg_policy, time) && !(flags & SCHED_CPUFREQ_CONTINUE)) { - if (flags & SCHED_CPUFREQ_RT_DL) { + if (0) { next_f = sg_policy->policy->cpuinfo.max_freq; sg_policy->cached_raw_freq = sg_policy->prev_cached_raw_freq; } else {