perf: Fix 'perf sched record' deadlock
authorMike Galbraith <efault@gmx.de>
Fri, 26 Mar 2010 10:11:33 +0000 (11:11 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 2 Apr 2010 17:30:05 +0000 (19:30 +0200)
commit8bb39f9aa068262732fe44b965d7a6eb5a5a7d67
tree820af25532c62179f518bda83ea27b6b21ee736b
parent257ef9d21f1b008a6c7425544b36641c4325a922
perf: Fix 'perf sched record' deadlock

perf sched record can deadlock a box should the holder of
handle->data->lock take an interrupt, and then attempt to
acquire an rq lock held by a CPU trying to acquire the
same lock. Disable interrupts.

   CPU0                            CPU1
   sched event with rq->lock held
                                   grab handle->data->lock
   spin on handle->data->lock
                                   interrupt
                                   try to grab rq->lock

Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Tested-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1269598293.6174.8.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_event.c