Skip to content

Commit b467f3e

Browse files
tehcastertorvalds
authored andcommitted
kernel/hung_task convert hung_task_panic boot parameter to sysctl
We can now handle sysctl parameters on kernel command line and have infrastructure to convert legacy command line options that duplicate sysctl to become a sysctl alias. This patch converts the hung_task_panic parameter. Note that the sysctl handler is more strict and allows only 0 and 1, while the legacy parameter allowed any non-zero value. But there is little reason anyone would not be using 1. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Christian Brauner <christian.brauner@ubuntu.com> Cc: David Rientjes <rientjes@google.com> Cc: "Eric W . Biederman" <ebiederm@xmission.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Guilherme G . Piccoli" <gpiccoli@canonical.com> Cc: Iurii Zaikin <yzaikin@google.com> Cc: Ivan Teterevkov <ivan.teterevkov@nutanix.com> Cc: Luis Chamberlain <mcgrof@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20200427180433.7029-4-vbabka@suse.cz Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0a477e1 commit b467f3e

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

‎Documentation/admin-guide/kernel-parameters.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@
15151515
[KNL] Should the hung task detector generate panics.
15161516
Format: <integer>
15171517

1518-
A nonzero value instructs the kernel to panic when a
1518+
A value of 1 instructs the kernel to panic when a
15191519
hung task is detected. The default value is controlled
15201520
by the CONFIG_BOOTPARAM_HUNG_TASK_PANIC build-time
15211521
option. The value selected by this boot parameter can

‎fs/proc/proc_sysctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,7 @@ struct sysctl_alias {
17211721
*/
17221722
static const struct sysctl_alias sysctl_aliases[] = {
17231723
{"numa_zonelist_order", "vm.numa_zonelist_order" },
1724+
{"hung_task_panic", "kernel.hung_task_panic" },
17241725
{ }
17251726
};
17261727

‎kernel/hung_task.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ static struct task_struct *watchdog_task;
6363
unsigned int __read_mostly sysctl_hung_task_panic =
6464
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE;
6565

66-
static int __init hung_task_panic_setup(char *str)
67-
{
68-
int rc = kstrtouint(str, 0, &sysctl_hung_task_panic);
69-
70-
if (rc)
71-
return rc;
72-
return 1;
73-
}
74-
__setup("hung_task_panic=", hung_task_panic_setup);
75-
7666
static int
7767
hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr)
7868
{

0 commit comments

Comments
 (0)