watchdog-hardlockup-move-perf-hardlockup-checking-panic-to-common-watchdogc.patch removed from -mm tree
The quilt patch titled
Subject: watchdog/hardlockup: move perf hardlockup checking/panic to common watchdog.c
has been removed from the -mm tree. Its filename was
watchdog-hardlockup-move-perf-hardlockup-checking-panic-to-common-watchdogc.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: Douglas Anderson <[email protected]>
Subject: watchdog/hardlockup: move perf hardlockup checking/panic to common watchdog.c
Date: Fri, 19 May 2023 10:18:32 -0700
The perf hardlockup detector works by looking at interrupt counts and seeing if they change from run to run. The interrupt counts are managed by the common watchdog code via its watchdog_timer_fn().
Currently the API between the perf detector and the common code is a
function: is_hardlockup(). When the hard lockup detector sees that function return true then it handles printing out debug info and inducing a panic if necessary.
Let's change the API a little bit in preparation for the buddy hardlockup detector. The buddy hardlockup detector wants to print nearly the same debug info and have nearly the same panic behavior. That means we want to move all that code to the common file. For now, the code in the common file will only be there if the perf hardlockup detector is enabled, but eventually it will be selected by a common config.
Right now, this _just_ moves the code from the perf detector file to the common file and changes the names. It doesn't make the changes that the buddy hardlockup detector will need and doesn't do any style cleanups. A future patch will do cleanup to make it more obvious what changed.
With the above, we no longer have any callers of is_hardlockup() outside of the "watchdog.c" file, so we can remove it from the header, make it static, and move it to the same "#ifdef" block as our new watchdog_hardlockup_check(). While doing this, it can be noted that even if no hardlockup detectors were configured the existing code used to still have the code for counting/checking "hrtimer_interrupts" even if the perf hardlockup detector wasn't configured. We didn't need to do that, so move all the "hrtimer_interrupts" counting to only be there if the perf hardlockup detector is configured as well.
This change is expected to be a no-op.
---
include/linux/nmi.h | 5 +- kernel/watchdog.c | 93 ++++++++++++++++++++++++++++++--------- kernel/watchdog_perf.c | 42 ----------------- 3 files changed, 78 insertions(+), 62 deletions(-)
include/linux/nmi.h renamed from include/linux/nmi.h~watchdog-hardlockup-move-perf-hardlockup-checking-panic-to-common-watchdogc +4 -1
@@ -15,7 +15,6 @@void lockup_detector_init (void );void lockup_detector_soft_poweroff (void );void lockup_detector_cleanup (void ); -bool is_hardlockup (void );extern int watchdog_user_enabled;extern int nmi_watchdog_user_enabled;
@@ -88,6 +87,10 @@ extern unsigned int hardlockup_panic;static inline void hardlockup_detector_disable (void ) {}#endif +#if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF ) +void watchdog_hardlockup_check (struct pt_regs *regs); +#endif +#if defined(CONFIG_HAVE_NMI_WATCHDOG ) || defined(CONFIG_HARDLOCKUP_DETECTOR )# define NMI_WATCHDOG_SYSCTL_PERM 0644#else
kernel/watchdog.c renamed from kernel/watchdog.c~watchdog-hardlockup-move-perf-hardlockup-checking-panic-to-common-watchdogc +73 -20
117 lines not on this page · raw message
kernel/watchdog_perf.c renamed from kernel/watchdog_perf.c~watchdog-hardlockup-move-perf-hardlockup-checking-panic-to-common-watchdogc +1 -41
59 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
watchdog-hardlockup-style-changes-to-watchdog_hardlockup_check-is_hardlockup.patch watchdog-hardlockup-add-a-cpu-param-to-watchdog_hardlockup_check.patch watchdog-hardlockup-move-perf-hardlockup-watchdog-petting-to-watchdogc.patch watchdog-hardlockup-rename-some-nmi-watchdog-constants-function.patch watchdog-hardlockup-have-the-perf-hardlockup-use-__weak-functions-more-cleanly.patch watchdog-hardlockup-detect-hard-lockups-using-secondary-buddy-cpus.patch watchdog-perf-add-a-weak-function-for-an-arch-to-detect-if-perf-can-use-nmis.patch arm64-enable-perf-events-based-hard-lockup-detector.patch