Message ID | 20220401202300.12660-2-alejandro.j.jimenez@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add sysctl entry for controlling crash_kexec_post_notifiers | expand |
On Fri, Apr 01, 2022 at 04:23:00PM -0400, Alejandro Jimenez wrote: > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 830aaf8ca08e..8e0be72b5fba 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -2339,6 +2339,13 @@ static struct ctl_table kern_table[] = { > .extra2 = SYSCTL_INT_MAX, > }, > #endif > + { > + .procname = "crash_kexec_post_notifiers", > + .data = &crash_kexec_post_notifiers, > + .maxlen = sizeof(int), > + .mode = 0644, > + .proc_handler = proc_dobool, > + }, > { } Please don't add any new sysctls to this file anymore. See sysctl-testing which trims its uses. Plenty of examples for you to see what to do, hopefully [0]. [0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=sysctl-testing Luis
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst index 1144ea3229a3..8e07121e2a58 100644 --- a/Documentation/admin-guide/sysctl/kernel.rst +++ b/Documentation/admin-guide/sysctl/kernel.rst @@ -213,6 +213,14 @@ If `core_pattern`_ does not include "%p" (default does not) and ``core_uses_pid`` is set, then .PID will be appended to the filename. +crash_kexec_post_notifiers +============ + +Allow the callbacks in panic notifier list to be called before kdump and dumping +kmsg. + +0 Do not call panic notifier list callbacks before kdump (default). +1 Call panic notifier list callbacks before kdump. ctrl-alt-del ============ diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h index 6a3b194c50fe..921e3ea01881 100644 --- a/include/uapi/linux/sysctl.h +++ b/include/uapi/linux/sysctl.h @@ -154,6 +154,7 @@ enum KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ KERN_PANIC_ON_WARN=77, /* int: call panic() in WARN() functions */ KERN_PANIC_PRINT=78, /* ulong: bitmask to print system info on panic */ + KERN_CRASH_KEXEC_POST_NOTIFIERS=79, /* bool: call panic notifier list before kdump */ }; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 830aaf8ca08e..8e0be72b5fba 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2339,6 +2339,13 @@ static struct ctl_table kern_table[] = { .extra2 = SYSCTL_INT_MAX, }, #endif + { + .procname = "crash_kexec_post_notifiers", + .data = &crash_kexec_post_notifiers, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dobool, + }, { } };