diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-04-12 23:07:34 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-04-15 13:20:54 +0300 |
commit | 8153f9ac43897f9f4786b30badc134fcc1a4fb11 (patch) | |
tree | 94f3d52a87a0e9dec031c899dd568fb0977d4e16 /drivers/cpufreq/ia64-acpi-cpufreq.c | |
parent | a5cbdf693a60d5b86d4d21dfedd90f17754eb273 (diff) | |
download | linux-8153f9ac43897f9f4786b30badc134fcc1a4fb11.tar.xz |
ACPI/processor: Replace racy task affinity logic
acpi_processor_get_throttling() requires to invoke the getter function on
the target CPU. This is achieved by temporarily setting the affinity of the
calling user space thread to the requested CPU and reset it to the original
affinity afterwards.
That's racy vs. CPU hotplug and concurrent affinity settings for that
thread resulting in code executing on the wrong CPU and overwriting the
new affinity setting.
acpi_processor_get_throttling() is invoked in two ways:
1) The CPU online callback, which is already running on the target CPU and
obviously protected against hotplug and not affected by affinity
settings.
2) The ACPI driver probe function, which is not protected against hotplug
during modprobe.
Switch it over to work_on_cpu() and protect the probe function against CPU
hotplug.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-acpi@vger.kernel.org
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Len Brown <lenb@kernel.org>
Link: http://lkml.kernel.org/r/20170412201042.785920903@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/cpufreq/ia64-acpi-cpufreq.c')
0 files changed, 0 insertions, 0 deletions