]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ksplice: add sysctls for determining Ksplice features.
authorJamie Iles <jamie.iles@oracle.com>
Tue, 17 Jan 2017 00:35:13 +0000 (00:35 +0000)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 5 Mar 2017 00:57:55 +0000 (16:57 -0800)
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 <jamie.iles@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
kernel/Makefile

arch/Kconfig
include/linux/ksplice.h [new file with mode: 0644]
kernel/Makefile
kernel/ksplice.c [new file with mode: 0644]
kernel/sysctl.c

index a65eafb24997e547168b152f04f96fe2e1aba01e..bd4def1444238f26cc71e167847cee42774c327e 100644 (file)
@@ -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 (file)
index 0000000..960826f
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ */
+#ifndef __LINUX_KSPLICE_H__
+#define __LINUX_KSPLICE_H__
+
+#include <linux/sysctl.h>
+
+extern const struct ctl_table ksplice_sysctls[];
+
+#endif /* __LINUX_KSPLICE_H__ */
index 60c302cfb4d3cbb976f0b2d69f28a96899b1d4ce..2acadd96d151fc8617011a94d2d36d627d029a56 100644 (file)
@@ -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 (file)
index 0000000..52c7af1
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ */
+#include <linux/ksplice.h>
+
+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,
+       },
+       { }
+};
index 5edf47efaedee435bbe605845ad3e5a27129074d..43c49bd30ea150ae148a96266e167566fcb81a4a 100644 (file)
@@ -64,6 +64,7 @@
 #include <linux/binfmts.h>
 #include <linux/sched/sysctl.h>
 #include <linux/kexec.h>
+#include <linux/ksplice.h>
 
 #include <asm/uaccess.h>
 #include <asm/processor.h>
@@ -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
        { }
 };