| From a.p.zijlstra@chello.nl Wed Aug 3 08:57:08 2011 |
| From: Peter Zijlstra <a.p.zijlstra@chello.nl> |
| Date: Wed, 03 Aug 2011 13:49:31 +0200 |
| Subject: perf: overflow/perf_count_sw_cpu_clock crashes recent kernels |
| To: Greg KH <greg@kroah.com> |
| Cc: Vince Weaver <vweaver1@eecs.utk.edu>, Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo <acme@ghostprotocols.net>, stable <stable@kernel.org> |
| Message-ID: <1312372171.1147.302.camel@twins> |
| |
| From: Peter Zijlstra <a.p.zijlstra@chello.nl> |
| |
| The below patch is for -stable only, upstream has a much larger patch |
| that contains the below hunk in commit a8b0ca17b80e92faab46ee7179ba9e99ccb61233 |
| |
| Vince found that under certain circumstances software event overflows |
| go wrong and deadlock. Avoid trying to delete a timer from the timer |
| callback. |
| |
| Reported-by: Vince Weaver <vweaver1@eecs.utk.edu> |
| Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
| |
| --- |
| kernel/perf_event.c | 8 ++------ |
| 1 file changed, 2 insertions(+), 6 deletions(-) |
| |
| --- a/kernel/perf_event.c |
| +++ b/kernel/perf_event.c |
| @@ -3694,12 +3694,8 @@ static int __perf_event_overflow(struct |
| if (events && atomic_dec_and_test(&event->event_limit)) { |
| ret = 1; |
| event->pending_kill = POLL_HUP; |
| - if (nmi) { |
| - event->pending_disable = 1; |
| - perf_pending_queue(&event->pending, |
| - perf_pending_event); |
| - } else |
| - perf_event_disable(event); |
| + event->pending_disable = 1; |
| + perf_pending_queue(&event->pending, perf_pending_event); |
| } |
| |
| perf_event_output(event, nmi, data, regs); |