perf/x86/ibs: Fix IBS throttle
authorPeter Zijlstra <[email protected]>
Fri, 11 Mar 2016 14:23:46 +0000 (15:23 +0100)
committerIngo Molnar <[email protected]>
Mon, 21 Mar 2016 08:08:15 +0000 (09:08 +0100)
When the IBS IRQ handler get a !0 return from perf_event_overflow;
meaning it should throttle the event, it only disables it, it doesn't
call perf_ibs_stop().

This confuses the state machine, as we'll use pmu::start() ->
perf_ibs_start() to unthrottle.

Tested-by: Borislav Petkov <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Cc: Vince Weaver <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/events/amd/ibs.c

index 51087c29b2c231906aa348fb9a78f046c81b2dc1..7956d29762ef5123ba54d2c51bc19edf412ab067 100644 (file)
@@ -599,7 +599,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
        throttle = perf_event_overflow(event, &data, &regs);
 out:
        if (throttle)
-               perf_ibs_disable_event(perf_ibs, hwc, *config);
+               perf_ibs_stop(event, 0);
        else
                perf_ibs_enable_event(perf_ibs, hwc, period >> 4);