From: Aaron Tomlin <atomlin@redhat.com>
To: Don Zickus <dzickus@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
uobergfe@redhat.com, jkosina@suse.cz
Subject: Re: [PATCH v2] watchdog: Add sysctl knob hardlockup_panic
Date: Sun, 18 Oct 2015 13:42:16 +0100 [thread overview]
Message-ID: <20151018124216.GA3737@atomlin.usersys.redhat.com> (raw)
In-Reply-To: <1444921616-233246-1-git-send-email-dzickus@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3429 bytes --]
On Thu 2015-10-15 11:06 -0400, Don Zickus wrote:
> The only way to enable a hardlockup to panic the machine is to set
> 'nmi_watchdog=panic' on the kernel command line.
>
> This makes it awkward for end users and folks who want to run automate tests
> (like myself).
>
> Mimic the softlockup_panic knob and create a /proc/sys/kernel/hardlockup_panic
> knob.
>
> Signed-off-by: Don Zickus <dzickus@redhat.com>
>
> --
> V2 - wrap the sysctl variable with CONFIG_HARDLOCKUP_DETECTOR (kbuid bot)
> ---
> Documentation/lockup-watchdogs.txt | 5 +++--
> include/linux/sched.h | 1 +
> kernel/sysctl.c | 11 +++++++++++
> kernel/watchdog.c | 2 +-
> 4 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/lockup-watchdogs.txt b/Documentation/lockup-watchdogs.txt
> index 22dd6af..4a6e33e 100644
> --- a/Documentation/lockup-watchdogs.txt
> +++ b/Documentation/lockup-watchdogs.txt
> @@ -20,8 +20,9 @@ kernel mode for more than 10 seconds (see "Implementation" below for
> details), without letting other interrupts have a chance to run.
> Similarly to the softlockup case, the current stack trace is displayed
> upon detection and the system will stay locked up unless the default
> -behavior is changed, which can be done through a compile time knob,
> -"BOOTPARAM_HARDLOCKUP_PANIC", and a kernel parameter, "nmi_watchdog"
> +behavior is changed, which can be done through a sysctl,
> +'hardlockup_panic', a compile time knob, "BOOTPARAM_HARDLOCKUP_PANIC",
> +and a kernel parameter, "nmi_watchdog"
> (see "Documentation/kernel-parameters.txt" for details).
>
> The panic option can be used in combination with panic_timeout (this
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index b7b9501..5e65b14 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -384,6 +384,7 @@ extern int proc_dowatchdog_thresh(struct ctl_table *table, int write,
> void __user *buffer,
> size_t *lenp, loff_t *ppos);
> extern unsigned int softlockup_panic;
> +extern unsigned int hardlockup_panic;
> void lockup_detector_init(void);
> #else
> static inline void touch_softlockup_watchdog(void)
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index efb0370..a341117 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -887,6 +887,17 @@ static struct ctl_table kern_table[] = {
> .extra1 = &zero,
> .extra2 = &one,
> },
> +#ifdef CONFIG_HARDLOCKUP_DETECTOR
> + {
> + .procname = "hardlockup_panic",
> + .data = &hardlockup_panic,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
> + .extra1 = &zero,
> + .extra2 = &one,
> + },
> +#endif
> #ifdef CONFIG_SMP
> {
> .procname = "softlockup_all_cpu_backtrace",
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index f6b32b8..0a23125 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -112,7 +112,7 @@ static unsigned long soft_lockup_nmi_warn;
> * Should we panic when a soft-lockup or hard-lockup occurs:
> */
> #ifdef CONFIG_HARDLOCKUP_DETECTOR
> -static int hardlockup_panic =
> +unsigned int __read_mostly hardlockup_panic =
> CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE;
> static unsigned long hardlockup_allcpu_dumped;
> /*
Reviewed-by: Aaron Tomlin <atomlin@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-10-18 12:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 15:06 [PATCH v2] watchdog: Add sysctl knob hardlockup_panic Don Zickus
2015-10-18 12:42 ` Aaron Tomlin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151018124216.GA3737@atomlin.usersys.redhat.com \
--to=atomlin@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dzickus@redhat.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=uobergfe@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.