Skip to content

Commit 1c80f4b

Browse files
author
Ingo Molnar
committed
perf_counter: x86: Disallow interval of 1
On certain CPUs i have observed a stuck PMU if interval was set to 1 and NMIs were used. The PMU had PMC0 set in MSR_CORE_PERF_GLOBAL_STATUS, but it was not possible to ack it via MSR_CORE_PERF_GLOBAL_OVF_CTRL, and the NMI loop got stuck infinitely. [ Impact: fix rare hangs during high perfcounter load ] Signed-off-by: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Corey Ashford <[email protected]> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <[email protected]>
1 parent a4016a7 commit 1c80f4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/kernel/cpu/perf_counter.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ x86_perf_counter_set_period(struct perf_counter *counter,
473473
left += period;
474474
atomic64_set(&hwc->period_left, left);
475475
}
476+
/*
477+
* Quirk: certain CPUs dont like it if just 1 event is left:
478+
*/
479+
if (unlikely(left < 2))
480+
left = 2;
476481

477482
per_cpu(prev_left[idx], smp_processor_id()) = left;
478483

0 commit comments

Comments
 (0)