perf: Fix event->ctx locking
authorPeter Zijlstra <peterz@infradead.org>
Fri, 23 Jan 2015 11:24:14 +0000 (12:24 +0100)
committerWinnie Hsu <whsu@nvidia.com>
Thu, 19 Apr 2018 17:02:11 +0000 (10:02 -0700)
commit5c5dcf965dc31b51735e1fb3556e76024c86871e
treeda79fbff18deda54a4385d301d0de2c5d3943f4a
parentc89a160df8862708602fe8857747251c8b481f7d
perf: Fix event->ctx locking

There have been a few reported issues wrt. the lack of locking around
changing event->ctx. This patch tries to address those.

It avoids the whole rwsem thing; and while it appears to work, please
give it some thought in review.

What I did fail at is sensible runtime checks on the use of
event->ctx, the RCU use makes it very hard.

Bug 1836932

Change-Id: Ia307722c251bb9a058df98f2061625cfcace984c
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20150123125834.209535886@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Signed-off-by: Amulya Yarlagadda <ayarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/1260590
Reviewed-on: https://git-master.nvidia.com/r/1696753
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>
kernel/events/core.c