Rafael J. Wysocki
b29c6ef7bb
x86 / CPU: Avoid unnecessary IPIs in arch_freq_get_on_cpu()
...
Even though aperfmperf_snapshot_khz() caches the samples.khz value to
return if called again in a sufficiently short time, its caller,
arch_freq_get_on_cpu(), still uses smp_call_function_single() to run it
which may allow user space to trigger an IPI storm by reading from the
scaling_cur_freq cpufreq sysfs file in a tight loop.
To avoid that, move the decision on whether or not to return the cached
samples.khz value to arch_freq_get_on_cpu().
This change was part of commit 941f5f0f6e ("x86: CPU: Fix up "cpu MHz"
in /proc/cpuinfo"), but it was not the reason for the revert and it
remains applicable.
Fixes: 4815d3c56d (cpufreq: x86: Make scaling_cur_freq behave more as expected)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com >
Reviewed-by: WANG Chao <chao.wang@ucloud.cn >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2017-11-13 19:42:39 -08:00
..
2017-11-10 10:03:13 +01:00
2017-11-13 19:07:38 -08:00
2017-11-13 19:42:39 -08:00
2017-11-07 10:53:06 +01:00
2017-11-07 10:30:18 +01:00
2017-11-07 12:20:09 +01:00
2017-06-28 06:54:46 -07:00
2017-10-22 13:06:02 +02:00
2016-12-25 14:30:04 -08:00
2017-11-02 11:10:55 +01:00
2017-09-14 11:59:30 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-12-12 19:25:04 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-07 20:44:56 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-07-30 12:04:41 +02:00
2017-07-18 11:38:01 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-31 21:34:48 +02:00
2017-10-25 11:01:08 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:53:06 +01:00
2017-11-07 10:53:06 +01:00
2017-08-01 13:02:37 +02:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:51:10 +01:00
2017-11-13 18:29:23 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-25 20:52:02 +02:00
2017-11-07 10:51:10 +01:00
2017-01-19 08:42:37 +01:00
2017-11-02 11:10:55 +01:00
2017-07-18 11:37:58 +02:00
2017-07-05 10:09:02 +02:00
2017-09-25 09:36:16 +02:00
2017-11-13 17:04:36 -08:00
2017-11-07 15:36:00 +01:00
2017-11-13 14:13:48 -08:00
2017-08-29 12:07:26 +02:00
2017-07-30 12:09:12 +02:00
2017-11-08 11:16:22 +01:00
2017-11-02 11:10:55 +01:00
2017-11-05 09:52:16 +01:00
2017-11-02 11:10:55 +01:00
2016-12-25 10:47:41 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 11:01:08 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-10 11:50:12 +02:00
2017-11-02 15:50:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-07 15:35:57 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:04:47 +01:00
2017-11-02 11:04:48 +01:00
2017-11-07 10:53:06 +01:00
2017-03-20 16:10:32 +01:00
2017-03-02 08:42:30 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-07-30 12:09:12 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-13 19:07:38 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-29 11:42:29 +02:00
2017-11-13 18:29:23 -08:00
2017-09-29 19:44:03 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-11-16 09:38:23 +01:00
2017-06-15 16:41:10 +02:00
2017-11-07 10:51:10 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-13 18:29:23 -08:00
2016-11-18 10:58:31 +01:00
2017-11-13 19:07:38 -08:00
2017-11-13 19:07:38 -08:00
2017-11-08 11:16:22 +01:00
2017-10-10 12:49:49 +02:00
2017-07-26 13:18:20 +02:00
2017-11-08 10:21:49 +01:00
2017-11-01 21:50:08 +01:00
2017-09-28 09:39:03 +02:00
2017-11-07 10:53:06 +01:00
2017-11-02 11:10:55 +01:00
2017-09-25 20:51:58 +02:00
2017-11-13 18:29:23 -08:00