sched: schedutil: change loop condition to get next_freq on shared policy
authorYoungtae Lee <yt0729.lee@samsung.com>
Tue, 14 Nov 2017 02:18:33 +0000 (11:18 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:30:21 +0000 (17:30 +0900)
Between CPUHP_AP_ONLINE_DYN notif for cpufreq and stopper,
schedutil can not see util of hotplug out core.
At this time, there is a task in the core which is hotplug out,
there is a problem that utilization of these tasks is not reflected.
To avoid this, schedutil sees through the online mask to find next_frequency.

Change-Id: I3fc28c605edb184de390727a5f4a3eaa73a8797c
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
kernel/sched/cpufreq_schedutil.c

index 0538e8bb2b101088f6c16c32596e23aa92bf02d0..7561b003d0f2254a3b1ba859f436625694a8aee6 100644 (file)
@@ -364,7 +364,7 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time)
        unsigned long util = 0, max = 1;
        unsigned int j;
 
-       for_each_cpu(j, policy->cpus) {
+       for_each_cpu_and(j, policy->related_cpus, cpu_online_mask) {
                struct sugov_cpu *j_sg_cpu = &per_cpu(sugov_cpu, j);
                unsigned long j_util, j_max;
                s64 delta_ns;