aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c76
1 files changed, 67 insertions, 9 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 26f65eaa01f9..afc1dc60f3f8 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -61,6 +61,7 @@
61#include <linux/kmod.h> 61#include <linux/kmod.h>
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 65
65#include <asm/uaccess.h> 66#include <asm/uaccess.h>
66#include <asm/processor.h> 67#include <asm/processor.h>
@@ -104,7 +105,6 @@ extern char core_pattern[];
104extern unsigned int core_pipe_limit; 105extern unsigned int core_pipe_limit;
105#endif 106#endif
106extern int pid_max; 107extern int pid_max;
107extern int min_free_kbytes;
108extern int pid_max_min, pid_max_max; 108extern int pid_max_min, pid_max_max;
109extern int sysctl_drop_caches; 109extern int sysctl_drop_caches;
110extern int percpu_pagelist_fraction; 110extern int percpu_pagelist_fraction;
@@ -157,14 +157,20 @@ extern int sysctl_tsb_ratio;
157 157
158#ifdef __hppa__ 158#ifdef __hppa__
159extern int pwrsw_enabled; 159extern int pwrsw_enabled;
160#endif
161
162#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
160extern int unaligned_enabled; 163extern int unaligned_enabled;
161#endif 164#endif
162 165
163#ifdef CONFIG_IA64 166#ifdef CONFIG_IA64
164extern int no_unaligned_warning;
165extern int unaligned_dump_stack; 167extern int unaligned_dump_stack;
166#endif 168#endif
167 169
170#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
171extern int no_unaligned_warning;
172#endif
173
168#ifdef CONFIG_PROC_SYSCTL 174#ifdef CONFIG_PROC_SYSCTL
169static int proc_do_cad_pid(struct ctl_table *table, int write, 175static int proc_do_cad_pid(struct ctl_table *table, int write,
170 void __user *buffer, size_t *lenp, loff_t *ppos); 176 void __user *buffer, size_t *lenp, loff_t *ppos);
@@ -256,9 +262,11 @@ static int min_sched_granularity_ns = 100000; /* 100 usecs */
256static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ 262static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
257static int min_wakeup_granularity_ns; /* 0 usecs */ 263static int min_wakeup_granularity_ns; /* 0 usecs */
258static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ 264static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
265#ifdef CONFIG_SMP
259static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; 266static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
260static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; 267static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
261#endif 268#endif /* CONFIG_SMP */
269#endif /* CONFIG_SCHED_DEBUG */
262 270
263#ifdef CONFIG_COMPACTION 271#ifdef CONFIG_COMPACTION
264static int min_extfrag_threshold; 272static int min_extfrag_threshold;
@@ -301,6 +309,7 @@ static struct ctl_table kern_table[] = {
301 .extra1 = &min_wakeup_granularity_ns, 309 .extra1 = &min_wakeup_granularity_ns,
302 .extra2 = &max_wakeup_granularity_ns, 310 .extra2 = &max_wakeup_granularity_ns,
303 }, 311 },
312#ifdef CONFIG_SMP
304 { 313 {
305 .procname = "sched_tunable_scaling", 314 .procname = "sched_tunable_scaling",
306 .data = &sysctl_sched_tunable_scaling, 315 .data = &sysctl_sched_tunable_scaling,
@@ -347,7 +356,45 @@ static struct ctl_table kern_table[] = {
347 .extra1 = &zero, 356 .extra1 = &zero,
348 .extra2 = &one, 357 .extra2 = &one,
349 }, 358 },
350#endif 359#endif /* CONFIG_SMP */
360#ifdef CONFIG_NUMA_BALANCING
361 {
362 .procname = "numa_balancing_scan_delay_ms",
363 .data = &sysctl_numa_balancing_scan_delay,
364 .maxlen = sizeof(unsigned int),
365 .mode = 0644,
366 .proc_handler = proc_dointvec,
367 },
368 {
369 .procname = "numa_balancing_scan_period_min_ms",
370 .data = &sysctl_numa_balancing_scan_period_min,
371 .maxlen = sizeof(unsigned int),
372 .mode = 0644,
373 .proc_handler = proc_dointvec,
374 },
375 {
376 .procname = "numa_balancing_scan_period_reset",
377 .data = &sysctl_numa_balancing_scan_period_reset,
378 .maxlen = sizeof(unsigned int),
379 .mode = 0644,
380 .proc_handler = proc_dointvec,
381 },
382 {
383 .procname = "numa_balancing_scan_period_max_ms",
384 .data = &sysctl_numa_balancing_scan_period_max,
385 .maxlen = sizeof(unsigned int),
386 .mode = 0644,
387 .proc_handler = proc_dointvec,
388 },
389 {
390 .procname = "numa_balancing_scan_size_mb",
391 .data = &sysctl_numa_balancing_scan_size,
392 .maxlen = sizeof(unsigned int),
393 .mode = 0644,
394 .proc_handler = proc_dointvec,
395 },
396#endif /* CONFIG_NUMA_BALANCING */
397#endif /* CONFIG_SCHED_DEBUG */
351 { 398 {
352 .procname = "sched_rt_period_us", 399 .procname = "sched_rt_period_us",
353 .data = &sysctl_sched_rt_period, 400 .data = &sysctl_sched_rt_period,
@@ -362,6 +409,13 @@ static struct ctl_table kern_table[] = {
362 .mode = 0644, 409 .mode = 0644,
363 .proc_handler = sched_rt_handler, 410 .proc_handler = sched_rt_handler,
364 }, 411 },
412 {
413 .procname = "sched_rr_timeslice_ms",
414 .data = &sched_rr_timeslice,
415 .maxlen = sizeof(int),
416 .mode = 0644,
417 .proc_handler = sched_rr_handler,
418 },
365#ifdef CONFIG_SCHED_AUTOGROUP 419#ifdef CONFIG_SCHED_AUTOGROUP
366 { 420 {
367 .procname = "sched_autogroup_enabled", 421 .procname = "sched_autogroup_enabled",
@@ -504,6 +558,8 @@ static struct ctl_table kern_table[] = {
504 .mode = 0644, 558 .mode = 0644,
505 .proc_handler = proc_dointvec, 559 .proc_handler = proc_dointvec,
506 }, 560 },
561#endif
562#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
507 { 563 {
508 .procname = "unaligned-trap", 564 .procname = "unaligned-trap",
509 .data = &unaligned_enabled, 565 .data = &unaligned_enabled,
@@ -565,7 +621,7 @@ static struct ctl_table kern_table[] = {
565 .extra2 = &one, 621 .extra2 = &one,
566 }, 622 },
567#endif 623#endif
568#ifdef CONFIG_HOTPLUG 624
569 { 625 {
570 .procname = "hotplug", 626 .procname = "hotplug",
571 .data = &uevent_helper, 627 .data = &uevent_helper,
@@ -573,7 +629,7 @@ static struct ctl_table kern_table[] = {
573 .mode = 0644, 629 .mode = 0644,
574 .proc_handler = proc_dostring, 630 .proc_handler = proc_dostring,
575 }, 631 },
576#endif 632
577#ifdef CONFIG_CHR_DEV_SG 633#ifdef CONFIG_CHR_DEV_SG
578 { 634 {
579 .procname = "sg-big-buff", 635 .procname = "sg-big-buff",
@@ -870,7 +926,7 @@ static struct ctl_table kern_table[] = {
870 .proc_handler = proc_doulongvec_minmax, 926 .proc_handler = proc_doulongvec_minmax,
871 }, 927 },
872#endif 928#endif
873#ifdef CONFIG_IA64 929#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
874 { 930 {
875 .procname = "ignore-unaligned-usertrap", 931 .procname = "ignore-unaligned-usertrap",
876 .data = &no_unaligned_warning, 932 .data = &no_unaligned_warning,
@@ -878,6 +934,8 @@ static struct ctl_table kern_table[] = {
878 .mode = 0644, 934 .mode = 0644,
879 .proc_handler = proc_dointvec, 935 .proc_handler = proc_dointvec,
880 }, 936 },
937#endif
938#ifdef CONFIG_IA64
881 { 939 {
882 .procname = "unaligned-dump-stack", 940 .procname = "unaligned-dump-stack",
883 .data = &unaligned_dump_stack, 941 .data = &unaligned_dump_stack,
@@ -1965,7 +2023,7 @@ static int proc_taint(struct ctl_table *table, int write,
1965 int i; 2023 int i;
1966 for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) { 2024 for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) {
1967 if ((tmptaint >> i) & 1) 2025 if ((tmptaint >> i) & 1)
1968 add_taint(i); 2026 add_taint(i, LOCKDEP_STILL_OK);
1969 } 2027 }
1970 } 2028 }
1971 2029
@@ -2042,7 +2100,7 @@ int proc_dointvec_minmax(struct ctl_table *table, int write,
2042static void validate_coredump_safety(void) 2100static void validate_coredump_safety(void)
2043{ 2101{
2044#ifdef CONFIG_COREDUMP 2102#ifdef CONFIG_COREDUMP
2045 if (suid_dumpable == SUID_DUMPABLE_SAFE && 2103 if (suid_dumpable == SUID_DUMP_ROOT &&
2046 core_pattern[0] != '/' && core_pattern[0] != '|') { 2104 core_pattern[0] != '/' && core_pattern[0] != '|') {
2047 printk(KERN_WARNING "Unsafe core_pattern used with "\ 2105 printk(KERN_WARNING "Unsafe core_pattern used with "\
2048 "suid_dumpable=2. Pipe handler or fully qualified "\ 2106 "suid_dumpable=2. Pipe handler or fully qualified "\