Skip to contentSkip to conversation

watchdog/core: Add watchdog_thresh command line parameter

PATCH Superseded Laurence Oberman 2 participants 2 messages Oct 30, 2018 – Nov 1, 2018 Documentation

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 watchdog/core: Add watchdog_thresh command line parameter

Both graphics and serial consoles are exposed to hard lockups when handling a large amount of messaging. The kernel watchdog_thresh parameter up to now has not been available to be set on the kernel line for early boot.
This patch allows the setting of watchdog_thresh to be increased when needed to extend the hard lockup timer in the console code. Note that this also affects the soft lockup detector

---
 Documentation/admin-guide/kernel-parameters.txt | 8 ++++++++
 kernel/watchdog.c                               | 7 +++++++
 2 files changed, 15 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +8 -0
index b90fe3b6bc6c..4263937f4aa9 100644
@@ -4957,6 +4957,14 @@
 			or other driver-specific files in the
 			Documentation/watchdog/ directory.
 
+        watchdog_thresh=
+                        [KNL]
+                        Set the hard lockup detector stall duration
+                        threshold in seconds. The soft lockup detector
+                        threshold is set to twice the value. A value of 0
+                        disables both lockup detectors. Default is 10
+                        seconds.
+
 	workqueue.watchdog_thresh=
 			If CONFIG_WQ_WATCHDOG is configured, workqueue can
 			warn stall conditions and dump internal state to
kernel/watchdog.c +7 -0
index 977918d5d350..8fbfda94a67b 100644
@@ -199,6 +199,13 @@ static int __init nosoftlockup_setup(char *str)
 }
 __setup("nosoftlockup", nosoftlockup_setup);
 
+static int __init watchdog_thresh_setup(char *str)
+{
+	get_option(&str, &watchdog_thresh);
+	return 1;
+}
+__setup("watchdog_thresh=", watchdog_thresh_setup);
+
 #ifdef CONFIG_SMP
 int __read_mostly sysctl_softlockup_all_cpu_backtrace;
 
Signature · 1 line
2.18.1
#1 lore raw

Laurence,

On Tue, 30 Oct 2018, Laurence Oberman wrote:

This looks much better.

But please send your patches first to yourself. Your subject ended up with '[PATCH] [PATCH V7]' instead of just '[PATCH V7]'

Quoted 3 lines

Both graphics and serial consoles are exposed to hard lockups when handling a large amount of messaging. The kernel watchdog_thresh parameter up to now has not been available to be set on the kernel line for

kernel command line please. kernel line does not mean anything,

Quoted 2 lines

early boot.
This patch allows the setting of watchdog_thresh to be increased

Again:

git grep 'This patch' Documentation/process/

This leads you to:

"Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy to do frotz", as if you are giving orders to the codebase to change its behaviour."

Documentation is there for a reason.

Quoted 7 lines

Both graphics and serial consoles are exposed to hard lockups when handling a large amount of messaging. The kernel watchdog_thresh parameter up to now has not been available to be set on the kernel line for early boot.
This patch allows the setting of watchdog_thresh to be increased when needed to extend the hard lockup timer in the console code. Note that this also affects the soft lockup detector

Just for nitpickings sake. The change log is slightly confusing. Let me give you a suggestion:

The hard and soft lockup detector threshold has a default value of 10 seconds which can only be changed via sysctl.

During early boot lockup detection can trigger when noisy debugging emits a large amount of messages to the console, but there is no way to set a larger threshold on the kernel command line. The detector can only be completely disabled.

Add a new watchdog_thresh= command line parameter to allow boot time control over the threshold. It works in the same way as the sysctl and affects both the soft and the hard lockup detectors.

Hmm?

Documentation/admin-guide/kernel-parameters.txt line 4960

Quoted 7 lines
Documentation/admin-guide/kernel-parameters.txt +1 -0
@@ -4957,6 +4957,14 @@
 			or other driver-specific files in the
 			Documentation/watchdog/ directory.
 
+        watchdog_thresh=

Please use tabs instead of spaces

Documentation/admin-guide/kernel-parameters.txt line 4966

Quoted 6 lines
Documentation/admin-guide/kernel-parameters.txt +6 -0
+                        [KNL]
+                        Set the hard lockup detector stall duration
+                        threshold in seconds. The soft lockup detector
+                        threshold is set to twice the value. A value of 0
+                        disables both lockup detectors. Default is 10
+                        seconds.

Same here.

Thanks,

tglx