perf/core: Robustify the perf_cgroup_from_task() RCU checks
authorStephane Eranian <eranian@google.com>
Thu, 12 Nov 2015 10:00:04 +0000 (11:00 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 23 Nov 2015 08:21:03 +0000 (09:21 +0100)
commit614e4c4ebc75517295bccd29b20ddbc5b52af6fc
tree67931aaaac4c9e81176140293348f3582ef2a742
parentddaaf4e291dd63db0667991e4a335fcf3a7df13e
perf/core: Robustify the perf_cgroup_from_task() RCU checks

This patch reinforces the lockdep checks performed by
perf_cgroup_from_tsk() by passing the perf_event_context
whenever possible. It is okay to not hold the RCU read lock
when we know we hold the ctx->lock. This patch makes sure this
property holds.

In some functions, such as perf_cgroup_sched_in(), we do not
pass the context because we are sure we are holding the RCU
read lock.

Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: edumazet@google.com
Link: http://lkml.kernel.org/r/1447322404-10920-3-git-send-email-eranian@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event_intel_cqm.c
include/linux/perf_event.h
kernel/events/core.c