Skip to content

Commit

Permalink
perf: overflow/perf_count_sw_cpu_clock crashes recent kernels
Browse files Browse the repository at this point in the history
The below patch is for -stable only, upstream has a much larger patch
that contains the below hunk in commit a8b0ca1

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>
  • Loading branch information
Peter Zijlstra authored and Greg Kroah-Hartman committed Aug 8, 2011
1 parent 3d24761 commit bb30b19
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -3694,12 +3694,8 @@ static int __perf_event_overflow(struct perf_event *event, int nmi,
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);
Expand Down

0 comments on commit bb30b19

Please sign in to comment.