watchdog: parameters to control hard and soft lockup detector individually
cover watchdog: parameters to control hard and soft lockup detector individually
This post follows up to https://lkml.org/lkml/2014/8/11/329.
During the discussion of that patch, Ingo Molnar commented in
https://lkml.org/lkml/2014/8/18/577.
"The softlockup and hardlockup detection control variables
should be in separate flags, inside and outside the kernel - they (should) not relate to each other."
Please refer to [PATCH 1/1] for a description of the proposed changes of the 'user interface' in /proc/sys/kernel and kernel command line parameters.
Ulrich Obergfell (1):
watchdog: parameters to control hard and soft lockup detector
individually
include/linux/nmi.h | 12 ++- kernel/sysctl.c | 21 ++++- kernel/watchdog.c | 250 +++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 236 insertions(+), 47 deletions(-)
Signature · 1 line
1.7.11.7
PATCH 1/1 watchdog: parameters to control hard and soft lockup detector individually
With the current user interface of the watchdog mechanism it is only possible to disable or enable both lockup detectors at the same time. This patch introduces new kernel parameters and changes the semantics of some existing kernel parameters, so that the hard lockup detector and the soft lockup detector can be disabled or enabled individually. With this patch applied, the user interface is as follows.
- parameters in /proc/sys/kernel
. soft_watchdog
This is a new parameter to control and examine the run state of the soft lockup detector.
. nmi_watchdog
The semantics of this parameter have changed. It can now be used to control and examine the run state of the hard lockup detector.
. watchdog
This parameter is still available to control the run state of both lockup detectors at the same time. If this parameter is examined, it shows the logical OR of soft_watchdog and nmi_watchdog.
. watchdog_thresh
The semantics of this parameter are not affected by the patch.
- kernel command line parameters
. nosoftlockup
The semantics of this parameter have changed. It can now be used to disable the soft lockup detector at boot time.
. nmi_watchdog=0 or nmi_watchdog=1
Disable or enable the hard lockup detector at boot time. The patch introduces '=1' as a new option.
. nowatchdog
The semantics of this parameter are not affected by the patch. It is still available to disable both lockup detectors at boot time.
--- include/linux/nmi.h | 12 ++- kernel/sysctl.c | 21 ++++- kernel/watchdog.c | 250 +++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 236 insertions(+), 47 deletions(-)
include/linux/nmi.h +10 -2
@@ -55,12 +55,20 @@ static inline bool trigger_allbutself_cpu_backtrace(void)#ifdef CONFIG_LOCKUP_DETECTOR int hw_nmi_is_cpu_stuck (struct pt_regs *);u64 hw_nmi_get_sample_period (int watchdog_thresh); +extern int nmi_watchdog_enabled; +extern int soft_watchdog_enabled;extern int watchdog_user_enabled;extern int watchdog_thresh;extern int sysctl_softlockup_all_cpu_backtrace;struct ctl_table ; -extern int proc_dowatchdog (struct ctl_table *,int , -void __user *,size_t *,loff_t *); +extern int proc_watchdog_thresh (struct ctl_table *,int , +void __user *,size_t *,loff_t *); +extern int proc_watchdog (struct ctl_table *,int , +void __user *,size_t *,loff_t *); +extern int proc_nmi_watchdog (struct ctl_table *,int , +void __user *,size_t *,loff_t *); +extern int proc_soft_watchdog (struct ctl_table *,int , +void __user *,size_t *,loff_t *);#endif #ifdef CONFIG_HAVE_ACPI_APEI_NMI
kernel/sysctl.c +17 -4
@@ -838,7 +838,7 @@ static struct ctl_table kern_table[] = { .data = &watchdog_user_enabled, .maxlen = sizeof (int), .mode = 0644, - .proc_handler = proc_dowatchdog, + .proc_handler = proc_watchdog, .extra1 = &zero, .extra2 = &one, },
@@ -847,7 +847,7 @@ static struct ctl_table kern_table[] = { .data = &watchdog_thresh, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dowatchdog, + .proc_handler = proc_watchdog_thresh, .extra1 = &zero, .extra2 = &sixty, },
@@ -873,10 +873,23 @@ static struct ctl_table kern_table[] = {#endif /* CONFIG_SMP */ { .procname = "nmi_watchdog", - .data = &watchdog_user_enabled, + .data = &nmi_watchdog_enabled, + .maxlen = sizeof (int), + .mode = 0644, + .proc_handler = proc_nmi_watchdog, + .extra1 = &zero, +#if defined(CONFIG_HAVE_NMI_WATCHDOG ) || defined(CONFIG_HARDLOCKUP_DETECTOR ) + .extra2 = &one, +#else + .extra2 = &zero, +#endif + }, + { + .procname = "soft_watchdog", + .data = &soft_watchdog_enabled, .maxlen = sizeof (int), .mode = 0644, - .proc_handler = proc_dowatchdog, + .proc_handler = proc_soft_watchdog, .extra1 = &zero, .extra2 = &one, },
kernel/watchdog.c +209 -41
360 lines not on this page · raw message
Signature · 1 line
1.7.11.7
Quoted 11 lines · Ulrich Obergfell
This post follows up to https://lkml.org/lkml/2014/8/11/329.
During the discussion of that patch, Ingo Molnar commented in
https://lkml.org/lkml/2014/8/18/577."The softlockup and hardlockup detection control variables
should be in separate flags, inside and outside the kernel - they (should) not relate to each other."Please refer to [PATCH 1/1] for a description of the proposed changes of the 'user interface' in
/proc/sys/kerneland kernel command line parameters.
Hi Uli,
Andrew just posted some of your other patches upstream for v3.18-rc1. Let's try to rebase these changes on top of those and see what it looks like.
Cheers,
Don
Quoted 20 lines
----- Original Message -----
From: "Don Zickus" <[email protected]>
To: "Ulrich Obergfell" <[email protected]>
Cc: [email protected]
Sent: Tuesday, October 14, 2014 4:56:12 PM
Subject: Re: [PATCH 0/1] watchdog: parameters to control hard and soft lockup detector individuallyQuoted 11 lines · Ulrich Obergfell
This post follows up to https://lkml.org/lkml/2014/8/11/329.
During the discussion of that patch, Ingo Molnar commented in
https://lkml.org/lkml/2014/8/18/577."The softlockup and hardlockup detection control variables
should be in separate flags, inside and outside the kernel - they (should) not relate to each other."Please refer to [PATCH 1/1] for a description of the proposed changes of the 'user interface' in
/proc/sys/kerneland kernel command line parameters.
Quoted 8 lines
Hi Uli,
Andrew just posted some of your other patches upstream for v3.18-rc1. Let's try to rebase these changes on top of those and see what it looks like.
Cheers,
Don
Don,
I rebased the changes and posted a 'version 2' series in
https://lkml.org/lkml/2014/10/17/340
Regards,
Uli