diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 34a604726d0b..49e13e1f8fe6 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/capability.h> | 62 | #include <linux/capability.h> |
63 | #include <linux/binfmts.h> | 63 | #include <linux/binfmts.h> |
64 | #include <linux/sched/sysctl.h> | 64 | #include <linux/sched/sysctl.h> |
65 | #include <linux/kexec.h> | ||
65 | 66 | ||
66 | #include <asm/uaccess.h> | 67 | #include <asm/uaccess.h> |
67 | #include <asm/processor.h> | 68 | #include <asm/processor.h> |
@@ -95,8 +96,6 @@ | |||
95 | #if defined(CONFIG_SYSCTL) | 96 | #if defined(CONFIG_SYSCTL) |
96 | 97 | ||
97 | /* External variables not in a header file. */ | 98 | /* External variables not in a header file. */ |
98 | extern int sysctl_overcommit_memory; | ||
99 | extern int sysctl_overcommit_ratio; | ||
100 | extern int max_threads; | 99 | extern int max_threads; |
101 | extern int suid_dumpable; | 100 | extern int suid_dumpable; |
102 | #ifdef CONFIG_COREDUMP | 101 | #ifdef CONFIG_COREDUMP |
@@ -122,6 +121,8 @@ extern int blk_iopoll_enabled; | |||
122 | static int sixty = 60; | 121 | static int sixty = 60; |
123 | #endif | 122 | #endif |
124 | 123 | ||
124 | static int __maybe_unused neg_one = -1; | ||
125 | |||
125 | static int zero; | 126 | static int zero; |
126 | static int __maybe_unused one = 1; | 127 | static int __maybe_unused one = 1; |
127 | static int __maybe_unused two = 2; | 128 | static int __maybe_unused two = 2; |
@@ -385,19 +386,21 @@ static struct ctl_table kern_table[] = { | |||
385 | .proc_handler = proc_dointvec, | 386 | .proc_handler = proc_dointvec, |
386 | }, | 387 | }, |
387 | { | 388 | { |
388 | .procname = "numa_balancing_settle_count", | ||
389 | .data = &sysctl_numa_balancing_settle_count, | ||
390 | .maxlen = sizeof(unsigned int), | ||
391 | .mode = 0644, | ||
392 | .proc_handler = proc_dointvec, | ||
393 | }, | ||
394 | { | ||
395 | .procname = "numa_balancing_migrate_deferred", | 389 | .procname = "numa_balancing_migrate_deferred", |
396 | .data = &sysctl_numa_balancing_migrate_deferred, | 390 | .data = &sysctl_numa_balancing_migrate_deferred, |
397 | .maxlen = sizeof(unsigned int), | 391 | .maxlen = sizeof(unsigned int), |
398 | .mode = 0644, | 392 | .mode = 0644, |
399 | .proc_handler = proc_dointvec, | 393 | .proc_handler = proc_dointvec, |
400 | }, | 394 | }, |
395 | { | ||
396 | .procname = "numa_balancing", | ||
397 | .data = NULL, /* filled in by handler */ | ||
398 | .maxlen = sizeof(unsigned int), | ||
399 | .mode = 0644, | ||
400 | .proc_handler = sysctl_numa_balancing, | ||
401 | .extra1 = &zero, | ||
402 | .extra2 = &one, | ||
403 | }, | ||
401 | #endif /* CONFIG_NUMA_BALANCING */ | 404 | #endif /* CONFIG_NUMA_BALANCING */ |
402 | #endif /* CONFIG_SCHED_DEBUG */ | 405 | #endif /* CONFIG_SCHED_DEBUG */ |
403 | { | 406 | { |
@@ -614,6 +617,18 @@ static struct ctl_table kern_table[] = { | |||
614 | .proc_handler = proc_dointvec, | 617 | .proc_handler = proc_dointvec, |
615 | }, | 618 | }, |
616 | #endif | 619 | #endif |
620 | #ifdef CONFIG_KEXEC | ||
621 | { | ||
622 | .procname = "kexec_load_disabled", | ||
623 | .data = &kexec_load_disabled, | ||
624 | .maxlen = sizeof(int), | ||
625 | .mode = 0644, | ||
626 | /* only handle a transition from default "0" to "1" */ | ||
627 | .proc_handler = proc_dointvec_minmax, | ||
628 | .extra1 = &one, | ||
629 | .extra2 = &one, | ||
630 | }, | ||
631 | #endif | ||
617 | #ifdef CONFIG_MODULES | 632 | #ifdef CONFIG_MODULES |
618 | { | 633 | { |
619 | .procname = "modprobe", | 634 | .procname = "modprobe", |
@@ -984,9 +999,10 @@ static struct ctl_table kern_table[] = { | |||
984 | { | 999 | { |
985 | .procname = "hung_task_warnings", | 1000 | .procname = "hung_task_warnings", |
986 | .data = &sysctl_hung_task_warnings, | 1001 | .data = &sysctl_hung_task_warnings, |
987 | .maxlen = sizeof(unsigned long), | 1002 | .maxlen = sizeof(int), |
988 | .mode = 0644, | 1003 | .mode = 0644, |
989 | .proc_handler = proc_doulongvec_minmax, | 1004 | .proc_handler = proc_dointvec_minmax, |
1005 | .extra1 = &neg_one, | ||
990 | }, | 1006 | }, |
991 | #endif | 1007 | #endif |
992 | #ifdef CONFIG_COMPAT | 1008 | #ifdef CONFIG_COMPAT |
@@ -1128,7 +1144,14 @@ static struct ctl_table vm_table[] = { | |||
1128 | .data = &sysctl_overcommit_ratio, | 1144 | .data = &sysctl_overcommit_ratio, |
1129 | .maxlen = sizeof(sysctl_overcommit_ratio), | 1145 | .maxlen = sizeof(sysctl_overcommit_ratio), |
1130 | .mode = 0644, | 1146 | .mode = 0644, |
1131 | .proc_handler = proc_dointvec, | 1147 | .proc_handler = overcommit_ratio_handler, |
1148 | }, | ||
1149 | { | ||
1150 | .procname = "overcommit_kbytes", | ||
1151 | .data = &sysctl_overcommit_kbytes, | ||
1152 | .maxlen = sizeof(sysctl_overcommit_kbytes), | ||
1153 | .mode = 0644, | ||
1154 | .proc_handler = overcommit_kbytes_handler, | ||
1132 | }, | 1155 | }, |
1133 | { | 1156 | { |
1134 | .procname = "page-cluster", | 1157 | .procname = "page-cluster", |