linux/include
Thomas Gleixner a63fbed776 perf/tracing/cpuhotplug: Fix locking order
perf, tracing, kprobes and jump_labels have a gazillion of ways to create
dependency lock chains. Some of those involve nested invocations of
get_online_cpus().

The conversion of the hotplug locking to a percpu rwsem requires to avoid
such nested calls. sys_perf_event_open() protects most of the syscall logic
against cpu hotplug. This causes nested calls and lock inversions versus
ftrace and kprobes in various interesting ways.

It's impossible to move the hotplug locking to the outer end of all call
chains in the involved facilities, so the hotplug protection in
sys_perf_event_open() needs to be solved differently.

Introduce 'pmus_mutex' which protects a perf private online cpumask. This
mutex is taken when the mask is updated in the cpu hotplug callbacks and
can be taken in sys_perf_event_open() to protect the swhash setup/teardown
code and when the final judgement about a valid event has to be made.

[ tglx: Produced changelog and fixed the swhash interaction ]

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Link: http://lkml.kernel.org/r/20170524081548.930941109@linutronix.de
2017-05-26 10:10:44 +02:00
..
acpi More ACPI updates for v4.12-rc1 2017-05-10 09:35:42 -07:00
asm-generic Kbuild UAPI header export updates for v4.12 2017-05-10 20:45:36 -07:00
clocksource clocksource: arm_arch_timer: add structs to describe MMIO timer 2017-04-19 16:11:48 +01:00
crypto Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2017-05-03 08:50:52 -07:00
drm mm, vmalloc: use __GFP_HIGHMEM implicitly 2017-05-08 17:15:13 -07:00
dt-bindings Sort of on the quieter side this time, which is probably due more 2017-05-10 13:38:18 -07:00
keys KEYS: Split role of the keyring pointer for keyring restrict functions 2017-04-03 10:24:56 -07:00
kvm KVM: arm/arm64: Fix bug when registering redist iodevs 2017-05-18 11:18:12 +02:00
linux perf/tracing/cpuhotplug: Fix locking order 2017-05-26 10:10:44 +02:00
math-emu
media [media] cec.h: merge cec-edid.h into cec.h 2017-04-19 06:53:18 -03:00
memory
misc
net net: x25: fix one potential use-after-free issue 2017-05-18 10:05:40 -04:00
pcmcia
ras
rdma smc_diag.h: fix include from userland 2017-05-11 00:18:39 +09:00
rxrpc
scsi Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2017-05-12 11:44:13 -07:00
soc powerpc updates for 4.12 part 2 2017-05-12 10:04:09 -07:00
sound ASoC: Updates for v4.12 2017-05-02 08:25:25 +02:00
target target/user: PGR Support 2017-05-01 22:21:45 -07:00
trace Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2017-05-12 11:58:45 -07:00
uapi USB fixes for 4.12-rc2 2017-05-20 08:52:34 -07:00
video uapi: export all headers under uapi directories 2017-05-11 00:21:54 +09:00
xen xen: Implement EFI reset_system callback 2017-05-02 12:06:50 +02:00