]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Call transition notifier only once for each policy
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 29 Apr 2019 09:33:58 +0000 (15:03 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 10 May 2019 10:20:36 +0000 (12:20 +0200)
commit3252fd7a37f93897f4920f719c6ab825d7e3fe23
tree98d5dc569e611f1cffec3a5c7bfeb66097c01283
parentd0394412d9eabf217ca2100dff476fa929851020
cpufreq: Call transition notifier only once for each policy

Currently, the notifiers are called once for each CPU of the policy->cpus
cpumask. It would be more optimal if the notifier can be called only
once and all the relevant information be provided to it. Out of the 23
drivers that register for the transition notifiers today, only 4 of them
do per-cpu updates and the callback for the rest can be called only once
for the policy without any impact.

This would also avoid multiple function calls to the notifier callbacks
and reduce multiple iterations of notifier core's code (which does
locking as well).

This patch adds pointer to the cpufreq policy to the struct
cpufreq_freqs, so the notifier callback has all the information
available to it with a single call. The five drivers which perform
per-cpu updates are updated to use the cpufreq policy. The freqs->cpu
field is redundant now and is removed.

Acked-by: David S. Miller <davem@davemloft.net> (sparc)
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/arm/kernel/smp.c
arch/sparc/kernel/time_64.c
arch/x86/kernel/tsc.c
arch/x86/kvm/x86.c
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h