diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 98c5549c8e2953e8367110a3dfeb8543270ef205..af1e63f249f38ae822643c945e5cf09f8396d6a6 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -4240,6 +4240,13 @@ static int __perf_event_overflow(struct perf_event *event, int nmi, struct hw_perf_event *hwc = &event->hw; int ret = 0; + /* + * Non-sampling counters might still use the PMI to fold short + * hardware counters, ignore those. + */ + if (unlikely(!is_sampling_event(event))) + return 0; + if (!throttle) { hwc->interrupts++; } else {