[PATCH 1/2] Revert "perf/core: Fix hardlockup failure caused by perf throttle"

Qing Wong posted 2 patches 2 days, 22 hours ago
[PATCH 1/2] Revert "perf/core: Fix hardlockup failure caused by perf throttle"
Posted by Qing Wong 2 days, 22 hours ago
From: Qing Wang <wangqing7171@gmail.com>

This reverts commit 15def34e2635ab7e0e96f1bc32e1b69609f14942.

The hardlockup failure does not exist because:
1. The hardlockup's watchdog event is a pinned event, which exclusively
occupies a dedicated PMC (Performance Monitoring Counter) and is unaffected
by PMC scheduling.
2. The hardware event throttling mechanism only disables the specific PMC
where throttling occurs, without impacting other PMCs. Consequently, The
hardlockup event's dedicated PMC remains entirely unaffected.

Signed-off-by: Qing Wang <wangqing7171@gmail.com>
---
 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0bb21659e252..29cdb240e104 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10049,8 +10049,8 @@ __perf_event_account_interrupt(struct perf_event *event, int throttle)
 		hwc->interrupts = 1;
 	} else {
 		hwc->interrupts++;
-		if (unlikely(throttle &&
-			     hwc->interrupts > max_samples_per_tick)) {
+		if (unlikely(throttle
+			     && hwc->interrupts >= max_samples_per_tick)) {
 			__this_cpu_inc(perf_throttled_count);
 			tick_dep_set_cpu(smp_processor_id(), TICK_DEP_BIT_PERF_EVENTS);
 			hwc->interrupts = MAX_INTERRUPTS;
-- 
2.43.0