From 102a0743326a03cd1a1202ceda21e175b7d3575c Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Tue, 20 Feb 2024 01:20:52 +0000
Subject: [PATCH] add new system file

---
 kernel/kernel/watchdog_hld.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/kernel/kernel/watchdog_hld.c b/kernel/kernel/watchdog_hld.c
index 6854433..1e8a49d 100644
--- a/kernel/kernel/watchdog_hld.c
+++ b/kernel/kernel/watchdog_hld.c
@@ -24,8 +24,6 @@
 static DEFINE_PER_CPU(bool, watchdog_nmi_touch);
 static DEFINE_PER_CPU(struct perf_event *, watchdog_ev);
 static DEFINE_PER_CPU(struct perf_event *, dead_event);
-static DEFINE_RAW_SPINLOCK(watchdog_output_lock);
-
 static struct cpumask dead_events_mask;
 
 static unsigned long hardlockup_allcpu_dumped;
@@ -116,13 +114,13 @@
 	/* Ensure the watchdog never gets throttled */
 	event->hw.interrupts = 0;
 
+	if (!watchdog_check_timestamp())
+		return;
+
 	if (__this_cpu_read(watchdog_nmi_touch) == true) {
 		__this_cpu_write(watchdog_nmi_touch, false);
 		return;
 	}
-
-	if (!watchdog_check_timestamp())
-		return;
 
 	/* check for a hardlockup
 	 * This is done by making sure our timer interrupt
@@ -136,15 +134,9 @@
 		/* only print hardlockups once */
 		if (__this_cpu_read(hard_watchdog_warn) == true)
 			return;
-		/*
-		 * If early-printk is enabled then make sure we do not
-		 * lock up in printk() and kill console logging:
-		 */
-		printk_kill();
 
-		raw_spin_lock(&watchdog_output_lock);
-
-		pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu);
+		pr_emerg("Watchdog detected hard LOCKUP on cpu %d\n",
+			 this_cpu);
 		print_modules();
 		print_irqtrace_events(current);
 		if (regs)
@@ -160,7 +152,6 @@
 				!test_and_set_bit(0, &hardlockup_allcpu_dumped))
 			trigger_allbutself_cpu_backtrace();
 
-		raw_spin_unlock(&watchdog_output_lock);
 		if (hardlockup_panic)
 			nmi_panic(regs, "Hard LOCKUP");
 

--
Gitblit v1.6.2