Skip to content

Commit e2948ef

Browse files
committed
Merge tag 'perf-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 perf fix from Ingo Molnar: "Fix a combined PEBS events bug on x86 Intel CPUs" * tag 'perf-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/ds: Don't clear ->pebs_data_cfg for the last PEBS event
2 parents f2f80ac + 312be9f commit e2948ef

File tree

1 file changed

+4
-4
lines changed
  • arch/x86/events/intel

1 file changed

+4
-4
lines changed

arch/x86/events/intel/ds.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,11 +1237,11 @@ pebs_update_state(bool needed_cb, struct cpu_hw_events *cpuc,
12371237
struct pmu *pmu = event->pmu;
12381238

12391239
/*
1240-
* Make sure we get updated with the first PEBS
1241-
* event. It will trigger also during removal, but
1242-
* that does not hurt:
1240+
* Make sure we get updated with the first PEBS event.
1241+
* During removal, ->pebs_data_cfg is still valid for
1242+
* the last PEBS event. Don't clear it.
12431243
*/
1244-
if (cpuc->n_pebs == 1)
1244+
if ((cpuc->n_pebs == 1) && add)
12451245
cpuc->pebs_data_cfg = PEBS_UPDATE_DS_SW;
12461246

12471247
if (needed_cb != pebs_needs_sched_cb(cpuc)) {

0 commit comments

Comments
 (0)