Skip to contentSkip to conversation

watchdog-allow-nmi-watchdog-to-use-raw-perf-event.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message May 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: watchdog: allow nmi watchdog to use raw perf event
has been removed from the -mm tree. Its filename was
watchdog-allow-nmi-watchdog-to-use-raw-perf-event.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Song Liu <[email protected]>
Subject: watchdog: allow nmi watchdog to use raw perf event
Date: Mon, 29 Apr 2024 23:02:36 -0700

NMI watchdog permanently consumes one hardware counters per CPU on the system. For systems that use many hardware counters, this causes more aggressive time multiplexing of perf events.

OTOH, some CPUs (mostly Intel) support "ref-cycles" event, which is rarely used. Add kernel cmdline arg nmi_watchdog=rNNN to configure the watchdog to use raw event. For example, on Intel CPUs, we can use "r300" to configure the watchdog to use ref-cycles event.

If the raw event does not work, fall back to use "cycles".

---

 Documentation/admin-guide/kernel-parameters.txt |    5 -
 include/linux/nmi.h                             |    2 
 kernel/watchdog.c                               |    2 
 kernel/watchdog_perf.c                          |   46 ++++++++++++++
 4 files changed, 53 insertions(+), 2 deletions(-)
Documentation/admin-guide/kernel-parameters.txt renamed from Documentation/admin-guide/kernel-parameters.txt~watchdog-allow-nmi-watchdog-to-use-raw-perf-event +3 -2
@@ -3773,10 +3773,12 @@
 			Format: [state][,regs][,debounce][,die]
 
 	nmi_watchdog=	[KNL,BUGS=X86] Debugging features for SMP kernels
-			Format: [panic,][nopanic,][num]
+			Format: [panic,][nopanic,][rNNN,][num]
 			Valid num: 0 or 1
 			0 - turn hardlockup detector in nmi_watchdog off
 			1 - turn hardlockup detector in nmi_watchdog on
+			rNNN - configure the watchdog with raw perf event 0xNNN
+
 			When panic is specified, panic when an NMI watchdog
 			timeout occurs (or 'nopanic' to not panic on an NMI
 			watchdog, if CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is set)
@@ -7464,4 +7466,3 @@
 				memory, and other data can't be written using
 				xmon commands.
 			off	xmon is disabled.
-
include/linux/nmi.h renamed from include/linux/nmi.h~watchdog-allow-nmi-watchdog-to-use-raw-perf-event +2 -0
@@ -105,10 +105,12 @@ void watchdog_hardlockup_check(unsigned
 extern void hardlockup_detector_perf_stop(void);
 extern void hardlockup_detector_perf_restart(void);
 extern void hardlockup_detector_perf_cleanup(void);
+extern void hardlockup_config_perf_event(const char *str);
 #else
 static inline void hardlockup_detector_perf_stop(void) { }
 static inline void hardlockup_detector_perf_restart(void) { }
 static inline void hardlockup_detector_perf_cleanup(void) { }
+static inline void hardlockup_config_perf_event(const char *str) { }
 #endif
 
 void watchdog_hardlockup_stop(void);
kernel/watchdog.c renamed from kernel/watchdog.c~watchdog-allow-nmi-watchdog-to-use-raw-perf-event +2 -0
@@ -80,6 +80,8 @@ next:
 		watchdog_hardlockup_user_enabled = 0;
 	else if (!strncmp(str, "1", 1))
 		watchdog_hardlockup_user_enabled = 1;
+	else if (!strncmp(str, "r", 1))
+		hardlockup_config_perf_event(str + 1);
 	while (*(str++)) {
 		if (*str == ',') {
 			str++;
kernel/watchdog_perf.c renamed from kernel/watchdog_perf.c~watchdog-allow-nmi-watchdog-to-use-raw-perf-event +46 -0

61 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are