Skip to content

Commit

Permalink
kernel/hung_task convert hung_task_panic boot parameter to sysctl
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: "Eric W . Biederman" <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Guilherme G . Piccoli" <[email protected]>
Cc: Iurii Zaikin <[email protected]>
Cc: Ivan Teterevkov <[email protected]>
Cc: Luis Chamberlain <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tehcaster authored and torvalds committed Jun 8, 2020
1 parent 0a477e1 commit b467f3e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@
[KNL] Should the hung task detector generate panics.
Format: <integer>

A nonzero value instructs the kernel to panic when a
A value of 1 instructs the kernel to panic when a
hung task is detected. The default value is controlled
by the CONFIG_BOOTPARAM_HUNG_TASK_PANIC build-time
option. The value selected by this boot parameter can
Expand Down
1 change: 1 addition & 0 deletions fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,7 @@ struct sysctl_alias {
*/
static const struct sysctl_alias sysctl_aliases[] = {
{"numa_zonelist_order", "vm.numa_zonelist_order" },
{"hung_task_panic", "kernel.hung_task_panic" },
{ }
};

Expand Down
10 changes: 0 additions & 10 deletions kernel/hung_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ static struct task_struct *watchdog_task;
unsigned int __read_mostly sysctl_hung_task_panic =
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE;

static int __init hung_task_panic_setup(char *str)
{
int rc = kstrtouint(str, 0, &sysctl_hung_task_panic);

if (rc)
return rc;
return 1;
}
__setup("hung_task_panic=", hung_task_panic_setup);

static int
hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr)
{
Expand Down

0 comments on commit b467f3e

Please sign in to comment.