remarkable-linux/kernel/events
Peter Zijlstra 058ebd0eba perf: Fix perf_lock_task_context() vs RCU
Jiri managed to trigger this warning:

 [] ======================================================
 [] [ INFO: possible circular locking dependency detected ]
 [] 3.10.0+ #228 Tainted: G        W
 [] -------------------------------------------------------
 [] p/6613 is trying to acquire lock:
 []  (rcu_node_0){..-...}, at: [<ffffffff810ca797>] rcu_read_unlock_special+0xa7/0x250
 []
 [] but task is already holding lock:
 []  (&ctx->lock){-.-...}, at: [<ffffffff810f2879>] perf_lock_task_context+0xd9/0x2c0
 []
 [] which lock already depends on the new lock.
 []
 [] the existing dependency chain (in reverse order) is:
 []
 [] -> #4 (&ctx->lock){-.-...}:
 [] -> #3 (&rq->lock){-.-.-.}:
 [] -> #2 (&p->pi_lock){-.-.-.}:
 [] -> #1 (&rnp->nocb_gp_wq[1]){......}:
 [] -> #0 (rcu_node_0){..-...}:

Paul was quick to explain that due to preemptible RCU we cannot call
rcu_read_unlock() while holding scheduler (or nested) locks when part
of the read side critical section was preemptible.

Therefore solve it by making the entire RCU read side non-preemptible.

Also pull out the retry from under the non-preempt to play nice with RT.

Reported-by: Jiri Olsa <jolsa@redhat.com>
Helped-out-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: <stable@kernel.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-07-12 11:11:09 +02:00
..
callchain.c perf: Add attribute to filter out callchains 2012-08-10 12:40:57 -03:00
core.c perf: Fix perf_lock_task_context() vs RCU 2013-07-12 11:11:09 +02:00
hw_breakpoint.c hw_breakpoint: Introduce "struct bp_cpuinfo" 2013-06-20 17:58:57 +02:00
internal.h perf: Fix mmap() accounting hole 2013-06-19 12:44:13 +02:00
Makefile uprobes: Move to kernel/events/ 2012-02-22 11:08:00 +01:00
ring_buffer.c perf: Fix vmalloc ring buffer pages handling 2013-05-01 12:34:46 +02:00
uprobes.c uretprobes: Remove -ENOSYS as return probes implemented 2013-04-13 15:31:58 +02:00