diff options
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 75 |
1 files changed, 54 insertions, 21 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 58be76017fd0..0dfaa47d7cb6 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -49,9 +49,8 @@ | |||
| 49 | #include <linux/acpi.h> | 49 | #include <linux/acpi.h> |
| 50 | #include <linux/reboot.h> | 50 | #include <linux/reboot.h> |
| 51 | #include <linux/ftrace.h> | 51 | #include <linux/ftrace.h> |
| 52 | #include <linux/security.h> | ||
| 53 | #include <linux/slow-work.h> | 52 | #include <linux/slow-work.h> |
| 54 | #include <linux/perf_counter.h> | 53 | #include <linux/perf_event.h> |
| 55 | 54 | ||
| 56 | #include <asm/uaccess.h> | 55 | #include <asm/uaccess.h> |
| 57 | #include <asm/processor.h> | 56 | #include <asm/processor.h> |
| @@ -92,6 +91,9 @@ extern int sysctl_nr_trim_pages; | |||
| 92 | #ifdef CONFIG_RCU_TORTURE_TEST | 91 | #ifdef CONFIG_RCU_TORTURE_TEST |
| 93 | extern int rcutorture_runnable; | 92 | extern int rcutorture_runnable; |
| 94 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 93 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
| 94 | #ifdef CONFIG_BLOCK | ||
| 95 | extern int blk_iopoll_enabled; | ||
| 96 | #endif | ||
| 95 | 97 | ||
| 96 | /* Constants used for minimum and maximum */ | 98 | /* Constants used for minimum and maximum */ |
| 97 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 99 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
| @@ -104,6 +106,9 @@ static int __maybe_unused one = 1; | |||
| 104 | static int __maybe_unused two = 2; | 106 | static int __maybe_unused two = 2; |
| 105 | static unsigned long one_ul = 1; | 107 | static unsigned long one_ul = 1; |
| 106 | static int one_hundred = 100; | 108 | static int one_hundred = 100; |
| 109 | #ifdef CONFIG_PRINTK | ||
| 110 | static int ten_thousand = 10000; | ||
| 111 | #endif | ||
| 107 | 112 | ||
| 108 | /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ | 113 | /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ |
| 109 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; | 114 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; |
| @@ -246,6 +251,14 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |||
| 246 | #endif | 251 | #endif |
| 247 | 252 | ||
| 248 | static struct ctl_table kern_table[] = { | 253 | static struct ctl_table kern_table[] = { |
| 254 | { | ||
| 255 | .ctl_name = CTL_UNNUMBERED, | ||
| 256 | .procname = "sched_child_runs_first", | ||
| 257 | .data = &sysctl_sched_child_runs_first, | ||
| 258 | .maxlen = sizeof(unsigned int), | ||
| 259 | .mode = 0644, | ||
| 260 | .proc_handler = &proc_dointvec, | ||
| 261 | }, | ||
| 249 | #ifdef CONFIG_SCHED_DEBUG | 262 | #ifdef CONFIG_SCHED_DEBUG |
| 250 | { | 263 | { |
| 251 | .ctl_name = CTL_UNNUMBERED, | 264 | .ctl_name = CTL_UNNUMBERED, |
| @@ -300,14 +313,6 @@ static struct ctl_table kern_table[] = { | |||
| 300 | }, | 313 | }, |
| 301 | { | 314 | { |
| 302 | .ctl_name = CTL_UNNUMBERED, | 315 | .ctl_name = CTL_UNNUMBERED, |
| 303 | .procname = "sched_child_runs_first", | ||
| 304 | .data = &sysctl_sched_child_runs_first, | ||
| 305 | .maxlen = sizeof(unsigned int), | ||
| 306 | .mode = 0644, | ||
| 307 | .proc_handler = &proc_dointvec, | ||
| 308 | }, | ||
| 309 | { | ||
| 310 | .ctl_name = CTL_UNNUMBERED, | ||
| 311 | .procname = "sched_features", | 316 | .procname = "sched_features", |
| 312 | .data = &sysctl_sched_features, | 317 | .data = &sysctl_sched_features, |
| 313 | .maxlen = sizeof(unsigned int), | 318 | .maxlen = sizeof(unsigned int), |
| @@ -332,6 +337,14 @@ static struct ctl_table kern_table[] = { | |||
| 332 | }, | 337 | }, |
| 333 | { | 338 | { |
| 334 | .ctl_name = CTL_UNNUMBERED, | 339 | .ctl_name = CTL_UNNUMBERED, |
| 340 | .procname = "sched_time_avg", | ||
| 341 | .data = &sysctl_sched_time_avg, | ||
| 342 | .maxlen = sizeof(unsigned int), | ||
| 343 | .mode = 0644, | ||
| 344 | .proc_handler = &proc_dointvec, | ||
| 345 | }, | ||
| 346 | { | ||
| 347 | .ctl_name = CTL_UNNUMBERED, | ||
| 335 | .procname = "timer_migration", | 348 | .procname = "timer_migration", |
| 336 | .data = &sysctl_timer_migration, | 349 | .data = &sysctl_timer_migration, |
| 337 | .maxlen = sizeof(unsigned int), | 350 | .maxlen = sizeof(unsigned int), |
| @@ -712,6 +725,17 @@ static struct ctl_table kern_table[] = { | |||
| 712 | .mode = 0644, | 725 | .mode = 0644, |
| 713 | .proc_handler = &proc_dointvec, | 726 | .proc_handler = &proc_dointvec, |
| 714 | }, | 727 | }, |
| 728 | { | ||
| 729 | .ctl_name = CTL_UNNUMBERED, | ||
| 730 | .procname = "printk_delay", | ||
| 731 | .data = &printk_delay_msec, | ||
| 732 | .maxlen = sizeof(int), | ||
| 733 | .mode = 0644, | ||
| 734 | .proc_handler = &proc_dointvec_minmax, | ||
| 735 | .strategy = &sysctl_intvec, | ||
| 736 | .extra1 = &zero, | ||
| 737 | .extra2 = &ten_thousand, | ||
| 738 | }, | ||
| 715 | #endif | 739 | #endif |
| 716 | { | 740 | { |
| 717 | .ctl_name = KERN_NGROUPS_MAX, | 741 | .ctl_name = KERN_NGROUPS_MAX, |
| @@ -954,28 +978,28 @@ static struct ctl_table kern_table[] = { | |||
| 954 | .child = slow_work_sysctls, | 978 | .child = slow_work_sysctls, |
| 955 | }, | 979 | }, |
| 956 | #endif | 980 | #endif |
| 957 | #ifdef CONFIG_PERF_COUNTERS | 981 | #ifdef CONFIG_PERF_EVENTS |
| 958 | { | 982 | { |
| 959 | .ctl_name = CTL_UNNUMBERED, | 983 | .ctl_name = CTL_UNNUMBERED, |
| 960 | .procname = "perf_counter_paranoid", | 984 | .procname = "perf_event_paranoid", |
| 961 | .data = &sysctl_perf_counter_paranoid, | 985 | .data = &sysctl_perf_event_paranoid, |
| 962 | .maxlen = sizeof(sysctl_perf_counter_paranoid), | 986 | .maxlen = sizeof(sysctl_perf_event_paranoid), |
| 963 | .mode = 0644, | 987 | .mode = 0644, |
| 964 | .proc_handler = &proc_dointvec, | 988 | .proc_handler = &proc_dointvec, |
| 965 | }, | 989 | }, |
| 966 | { | 990 | { |
| 967 | .ctl_name = CTL_UNNUMBERED, | 991 | .ctl_name = CTL_UNNUMBERED, |
| 968 | .procname = "perf_counter_mlock_kb", | 992 | .procname = "perf_event_mlock_kb", |
| 969 | .data = &sysctl_perf_counter_mlock, | 993 | .data = &sysctl_perf_event_mlock, |
| 970 | .maxlen = sizeof(sysctl_perf_counter_mlock), | 994 | .maxlen = sizeof(sysctl_perf_event_mlock), |
| 971 | .mode = 0644, | 995 | .mode = 0644, |
| 972 | .proc_handler = &proc_dointvec, | 996 | .proc_handler = &proc_dointvec, |
| 973 | }, | 997 | }, |
| 974 | { | 998 | { |
| 975 | .ctl_name = CTL_UNNUMBERED, | 999 | .ctl_name = CTL_UNNUMBERED, |
| 976 | .procname = "perf_counter_max_sample_rate", | 1000 | .procname = "perf_event_max_sample_rate", |
| 977 | .data = &sysctl_perf_counter_sample_rate, | 1001 | .data = &sysctl_perf_event_sample_rate, |
| 978 | .maxlen = sizeof(sysctl_perf_counter_sample_rate), | 1002 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
| 979 | .mode = 0644, | 1003 | .mode = 0644, |
| 980 | .proc_handler = &proc_dointvec, | 1004 | .proc_handler = &proc_dointvec, |
| 981 | }, | 1005 | }, |
| @@ -990,7 +1014,16 @@ static struct ctl_table kern_table[] = { | |||
| 990 | .proc_handler = &proc_dointvec, | 1014 | .proc_handler = &proc_dointvec, |
| 991 | }, | 1015 | }, |
| 992 | #endif | 1016 | #endif |
| 993 | 1017 | #ifdef CONFIG_BLOCK | |
| 1018 | { | ||
| 1019 | .ctl_name = CTL_UNNUMBERED, | ||
| 1020 | .procname = "blk_iopoll", | ||
| 1021 | .data = &blk_iopoll_enabled, | ||
| 1022 | .maxlen = sizeof(int), | ||
| 1023 | .mode = 0644, | ||
| 1024 | .proc_handler = &proc_dointvec, | ||
| 1025 | }, | ||
| 1026 | #endif | ||
| 994 | /* | 1027 | /* |
| 995 | * NOTE: do not add new entries to this table unless you have read | 1028 | * NOTE: do not add new entries to this table unless you have read |
| 996 | * Documentation/sysctl/ctl_unnumbered.txt | 1029 | * Documentation/sysctl/ctl_unnumbered.txt |
