perf: Fix PERF_EVENT_IOC_PERIOD migration race
authorPeter Zijlstra <peterz@infradead.org>
Tue, 4 Aug 2015 17:22:49 +0000 (19:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 16:10:48 +0000 (09:10 -0700)
commit5862cc57bf06425230531950e2f6858244ad626f
tree6f53ad64eaeaadb6d820d9890caca786f214fe88
parentcf766f632368c773fec1936d941322bbc2e1484b
perf: Fix PERF_EVENT_IOC_PERIOD migration race

commit c7999c6f3fed9e383d3131474588f282ae6d56b9 upstream.

I ran the perf fuzzer, which triggered some WARN()s which are due to
trying to stop/restart an event on the wrong CPU.

Use the normal IPI pattern to ensure we run the code on the correct CPU.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: bad7192b842c ("perf: Fix PERF_EVENT_IOC_PERIOD to force-reset the period")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/events/core.c