From: Jamie Iles Date: Tue, 17 Jan 2017 00:35:13 +0000 (+0000) Subject: ksplice: add sysctls for determining Ksplice features. X-Git-Tag: v4.1.12-93~3^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cff48f7deace38f8fe17962e1b3e87fb0f643328;p=users%2Fjedix%2Flinux-maple.git ksplice: add sysctls for determining Ksplice features. This adds a new set of sysctls that the Ksplice user-space can use for feature tests. The first sysctl added is ksplice.init_trace_safe which means that it is safe to trace a child_subreaper processes without making them killable which was fixed in 2d39b3cd34 (signal: protect SIGNAL_UNKILLABLE from unintentional clearing.). Ksplice can now test this sysctl and use that to determine whether it is safe to trace init or not. Future sysctls can be added for other features, as well as kernel internal features for kernel Ksplice. Orabug: 25414814 Signed-off-by: Jamie Iles Reviewed-by: Dhaval Giani Conflicts: kernel/Makefile --- diff --git a/arch/Kconfig b/arch/Kconfig index a65eafb24997..bd4def144423 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -546,3 +546,10 @@ config COMPAT_OLD_SIGACTION bool source "kernel/gcov/Kconfig" + +config KSPLICE + bool "Ksplice" + depends on MODULES + select SYSCTL + help + Enable helper features for supporting Ksplice zero-downtime updates. diff --git a/include/linux/ksplice.h b/include/linux/ksplice.h new file mode 100644 index 000000000000..960826fe7d01 --- /dev/null +++ b/include/linux/ksplice.h @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2017 Oracle Corporation + */ +#ifndef __LINUX_KSPLICE_H__ +#define __LINUX_KSPLICE_H__ + +#include + +extern const struct ctl_table ksplice_sysctls[]; + +#endif /* __LINUX_KSPLICE_H__ */ diff --git a/kernel/Makefile b/kernel/Makefile index 60c302cfb4d3..2acadd96d151 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -98,6 +98,7 @@ obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_JUMP_LABEL) += jump_label.o obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o obj-$(CONFIG_TORTURE_TEST) += torture.o +obj-$(CONFIG_KSPLICE) += ksplice.o $(obj)/configs.o: $(obj)/config_data.h diff --git a/kernel/ksplice.c b/kernel/ksplice.c new file mode 100644 index 000000000000..52c7af17d7e9 --- /dev/null +++ b/kernel/ksplice.c @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2017 Oracle Corporation + */ +#include + +static int init_trace_safe = 1; + +const struct ctl_table ksplice_sysctls[] = { + { + .procname = "init_trace_safe", + .data = &init_trace_safe, + .maxlen = sizeof(int), + .mode = 0444, + .proc_handler = proc_dointvec, + }, + { } +}; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 5edf47efaede..43c49bd30ea1 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -1141,6 +1142,13 @@ static struct ctl_table kern_table[] = { .extra1 = &zero, .extra2 = &one, }, +#ifdef CONFIG_KSPLICE + { + .procname = "ksplice", + .mode = 0555, + .child = ksplice_sysctls, + }, +#endif { } };