From b91319892e5cfd7e6a506ce4b7117ffed5d6de06 Mon Sep 17 00:00:00 2001 From: Saravana Kannan Date: Thu, 4 May 2017 19:44:36 -0700 Subject: [PATCH] cpufreq: schedutil: Don't jump to max frequency for RT tasks Android uses a lot of RT threads. Jumping to max frequency for RT tasks will cause a significant degradation in power that would not be acceptable for mobile devices. So, stop doing that. Change-Id: I4e1056c678755014e38eaafe05e890ff2e38c42e Signed-off-by: Saravana Kannan Signed-off-by: Rohit Gupta --- kernel/sched/cpufreq_schedutil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 2f52ec0f1539..00e771a5828f 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -264,6 +264,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, unsigned int next_f; bool busy; + flags &= ~SCHED_CPUFREQ_RT_DL; sugov_set_iowait_boost(sg_cpu, time, flags); sg_cpu->last_update = time; @@ -343,6 +344,8 @@ 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;