perf: Robustify event->owner usage and SMP ordering
authorPeter Zijlstra <peterz@infradead.org>
Tue, 26 Jan 2016 11:30:14 +0000 (12:30 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 29 Jan 2016 07:35:31 +0000 (08:35 +0100)
commitf47c02c0c8403963fbb8c3484e285727305d0f73
tree3672f498ef05670f261a8bfbfd66925eca852879
parent6e801e016917989ab8a7ddfc4229a15a5621622a
perf: Robustify event->owner usage and SMP ordering

Use smp_store_release() to clear event->owner and
lockless_dereference() to observe it. Further use READ_ONCE() for all
lockless reads.

This changes perf_remove_from_owner() to leave event->owner cleared.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c