From: Viresh Kumar Date: Thu, 10 Aug 2017 04:20:55 +0000 (+0530) Subject: cpufreq: schedutil: Don't restrict kthread to related_cpus unnecessarily X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e2cabe48c20efb174ce0c01190f8b9c5f3ea1d13;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git cpufreq: schedutil: Don't restrict kthread to related_cpus unnecessarily Utilization update callbacks are now processed remotely, even on the CPUs that don't share cpufreq policy with the target CPU (if dvfs_possible_from_any_cpu flag is set). But in non-fast switch paths, the frequency is changed only from one of policy->related_cpus. This happens because the kthread which does the actual update is bound to a subset of CPUs (i.e. related_cpus). Allow frequency to be remotely updated as well (i.e. call __cpufreq_driver_target()) if dvfs_possible_from_any_cpu flag is set. Reported-by: Pavan Kondeti Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 2ba04bb3182a..69571ee6a175 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -487,7 +487,11 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy) } sg_policy->thread = thread; - kthread_bind_mask(thread, policy->related_cpus); + + /* Kthread is bound to all CPUs by default */ + if (!policy->dvfs_possible_from_any_cpu) + kthread_bind_mask(thread, policy->related_cpus); + init_irq_work(&sg_policy->irq_work, sugov_irq_work); mutex_init(&sg_policy->work_lock);