Skip to content

Commit 5debf02

Browse files
namhyungPeter Zijlstra
authored andcommitted
perf/x86/intel: Fix a warning on x86_pmu_stop() with large PEBS
The commit 3966c3f ("x86/perf/amd: Remove need to check "running" bit in NMI handler") introduced this. It seems x86_pmu_stop can be called recursively (like when it losts some samples) like below: x86_pmu_stop intel_pmu_disable_event (x86_pmu_disable) intel_pmu_pebs_disable intel_pmu_drain_pebs_nhm (x86_pmu_drain_pebs_buffer) x86_pmu_stop While commit 35d1ce6 ("perf/x86/intel/ds: Fix x86_pmu_stop warning for large PEBS") fixed it for the normal cases, there's another path to call x86_pmu_stop() recursively when a PEBS error was detected (like two or more counters overflowed at the same time). Like in the Kan's previous fix, we can skip the interrupt accounting for large PEBS, so check the iregs which is set for PMI only. Fixes: 3966c3f ("x86/perf/amd: Remove need to check "running" bit in NMI handler") Reported-by: John Sperbeck <jsperbeck@google.com> Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20201126110922.317681-1-namhyung@kernel.org
1 parent ebd19fc commit 5debf02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • arch/x86/events/intel

arch/x86/events/intel/ds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d
19401940
if (error[bit]) {
19411941
perf_log_lost_samples(event, error[bit]);
19421942

1943-
if (perf_event_account_interrupt(event))
1943+
if (iregs && perf_event_account_interrupt(event))
19441944
x86_pmu_stop(event, 0);
19451945
}
19461946

0 commit comments

Comments
 (0)