Commit f8df957
committed
perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read
JIRA: https://issues.redhat.com/browse/RHEL-47444
upstream
========
commit f9bdf1f
Author: Kan Liang <kan.liang@linux.intel.com>
Date: Tue Jan 21 07:23:01 2025 -0800
description
===========
The WARN_ON(this_cpu_read(cpu_hw_events.enabled)) in the
intel_pmu_save_and_restart_reload() is triggered, when sampling read
topdown events.
In a NMI handler, the cpu_hw_events.enabled is set and used to indicate
the status of core PMU. The generic pmu->pmu_disable_count, updated in
the perf_pmu_disable/enable pair, is not touched.
However, the perf_pmu_disable/enable pair is invoked when sampling read
in a NMI handler. The cpuc->enabled is mistakenly set by the
perf_pmu_enable().
Avoid disabling PMU if the core PMU is already disabled.
Merge the logic together.
Fixes: 7b2c05a ("perf/x86/intel: Generic support for hardware TopDown metrics")
Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20250121152303.3128733-2-kan.liang@linux.intel.com
Signed-off-by: Michael Petlan <mpetlan@redhat.com>1 parent 326fbde commit f8df957
3 files changed
+25
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2774 | 2774 | | |
2775 | 2775 | | |
2776 | 2776 | | |
2777 | | - | |
| 2777 | + | |
2778 | 2778 | | |
2779 | | - | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
2780 | 2782 | | |
2781 | | - | |
2782 | | - | |
2783 | | - | |
2784 | | - | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
2785 | 2786 | | |
2786 | | - | |
2787 | | - | |
2788 | | - | |
2789 | | - | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
2790 | 2790 | | |
2791 | | - | |
2792 | | - | |
2793 | | - | |
2794 | | - | |
2795 | | - | |
2796 | | - | |
2797 | | - | |
2798 | | - | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
2799 | 2804 | | |
2800 | 2805 | | |
2801 | 2806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
952 | 952 | | |
953 | 953 | | |
954 | 954 | | |
955 | | - | |
| 955 | + | |
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
| |||
2099 | 2099 | | |
2100 | 2100 | | |
2101 | 2101 | | |
2102 | | - | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
2111 | 2102 | | |
2112 | 2103 | | |
2113 | 2104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1642 | 1642 | | |
1643 | 1643 | | |
1644 | 1644 | | |
1645 | | - | |
| 1645 | + | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | 1648 | | |
| |||
0 commit comments