Merge tag 'pm-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
"This fixes a schedutil cpufreq governor regression from the 4.14 cycle
that may cause a CPU idleness check to return incorrect results in
some cases which leads to suboptimal decisions (Joel Fernandes)"

* tag 'pm-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: schedutil: Use idle_calls counter of the remote CPU

+15 -1
+1
include/linux/tick.h
··· 119 119 extern void tick_nohz_irq_exit(void); 120 120 extern ktime_t tick_nohz_get_sleep_length(void); 121 121 extern unsigned long tick_nohz_get_idle_calls(void); 122 + extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu); 122 123 extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); 123 124 extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); 124 125 #else /* !CONFIG_NO_HZ_COMMON */
+1 -1
kernel/sched/cpufreq_schedutil.c
··· 244 244 #ifdef CONFIG_NO_HZ_COMMON 245 245 static bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) 246 246 { 247 - unsigned long idle_calls = tick_nohz_get_idle_calls(); 247 + unsigned long idle_calls = tick_nohz_get_idle_calls_cpu(sg_cpu->cpu); 248 248 bool ret = idle_calls == sg_cpu->saved_idle_calls; 249 249 250 250 sg_cpu->saved_idle_calls = idle_calls;
+13
kernel/time/tick-sched.c
··· 986 986 } 987 987 988 988 /** 989 + * tick_nohz_get_idle_calls_cpu - return the current idle calls counter value 990 + * for a particular CPU. 991 + * 992 + * Called from the schedutil frequency scaling governor in scheduler context. 993 + */ 994 + unsigned long tick_nohz_get_idle_calls_cpu(int cpu) 995 + { 996 + struct tick_sched *ts = tick_get_tick_sched(cpu); 997 + 998 + return ts->idle_calls; 999 + } 1000 + 1001 + /** 989 1002 * tick_nohz_get_idle_calls - return the current idle calls counter value 990 1003 * 991 1004 * Called from the schedutil frequency scaling governor in scheduler context.