diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 96 |
1 files changed, 49 insertions, 47 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index c33a1edb799f..0f1bd83db985 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/sysctl.h> | 25 | #include <linux/sysctl.h> |
26 | #include <linux/signal.h> | 26 | #include <linux/signal.h> |
27 | #include <linux/printk.h> | ||
27 | #include <linux/proc_fs.h> | 28 | #include <linux/proc_fs.h> |
28 | #include <linux/security.h> | 29 | #include <linux/security.h> |
29 | #include <linux/ctype.h> | 30 | #include <linux/ctype.h> |
@@ -169,7 +170,8 @@ static int proc_taint(struct ctl_table *table, int write, | |||
169 | #endif | 170 | #endif |
170 | 171 | ||
171 | #ifdef CONFIG_MAGIC_SYSRQ | 172 | #ifdef CONFIG_MAGIC_SYSRQ |
172 | static int __sysrq_enabled; /* Note: sysrq code ises it's own private copy */ | 173 | /* Note: sysrq code uses it's own private copy */ |
174 | static int __sysrq_enabled = SYSRQ_DEFAULT_ENABLE; | ||
173 | 175 | ||
174 | static int sysrq_sysctl_handler(ctl_table *table, int write, | 176 | static int sysrq_sysctl_handler(ctl_table *table, int write, |
175 | void __user *buffer, size_t *lenp, | 177 | void __user *buffer, size_t *lenp, |
@@ -245,10 +247,6 @@ static struct ctl_table root_table[] = { | |||
245 | .mode = 0555, | 247 | .mode = 0555, |
246 | .child = dev_table, | 248 | .child = dev_table, |
247 | }, | 249 | }, |
248 | /* | ||
249 | * NOTE: do not add new entries to this table unless you have read | ||
250 | * Documentation/sysctl/ctl_unnumbered.txt | ||
251 | */ | ||
252 | { } | 250 | { } |
253 | }; | 251 | }; |
254 | 252 | ||
@@ -259,8 +257,6 @@ static int min_wakeup_granularity_ns; /* 0 usecs */ | |||
259 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | 257 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
260 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; | 258 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; |
261 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; | 259 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; |
262 | static int min_sched_shares_ratelimit = 100000; /* 100 usec */ | ||
263 | static int max_sched_shares_ratelimit = NSEC_PER_SEC; /* 1 second */ | ||
264 | #endif | 260 | #endif |
265 | 261 | ||
266 | #ifdef CONFIG_COMPACTION | 262 | #ifdef CONFIG_COMPACTION |
@@ -305,15 +301,6 @@ static struct ctl_table kern_table[] = { | |||
305 | .extra2 = &max_wakeup_granularity_ns, | 301 | .extra2 = &max_wakeup_granularity_ns, |
306 | }, | 302 | }, |
307 | { | 303 | { |
308 | .procname = "sched_shares_ratelimit", | ||
309 | .data = &sysctl_sched_shares_ratelimit, | ||
310 | .maxlen = sizeof(unsigned int), | ||
311 | .mode = 0644, | ||
312 | .proc_handler = sched_proc_update_handler, | ||
313 | .extra1 = &min_sched_shares_ratelimit, | ||
314 | .extra2 = &max_sched_shares_ratelimit, | ||
315 | }, | ||
316 | { | ||
317 | .procname = "sched_tunable_scaling", | 304 | .procname = "sched_tunable_scaling", |
318 | .data = &sysctl_sched_tunable_scaling, | 305 | .data = &sysctl_sched_tunable_scaling, |
319 | .maxlen = sizeof(enum sched_tunable_scaling), | 306 | .maxlen = sizeof(enum sched_tunable_scaling), |
@@ -323,14 +310,6 @@ static struct ctl_table kern_table[] = { | |||
323 | .extra2 = &max_sched_tunable_scaling, | 310 | .extra2 = &max_sched_tunable_scaling, |
324 | }, | 311 | }, |
325 | { | 312 | { |
326 | .procname = "sched_shares_thresh", | ||
327 | .data = &sysctl_sched_shares_thresh, | ||
328 | .maxlen = sizeof(unsigned int), | ||
329 | .mode = 0644, | ||
330 | .proc_handler = proc_dointvec_minmax, | ||
331 | .extra1 = &zero, | ||
332 | }, | ||
333 | { | ||
334 | .procname = "sched_migration_cost", | 313 | .procname = "sched_migration_cost", |
335 | .data = &sysctl_sched_migration_cost, | 314 | .data = &sysctl_sched_migration_cost, |
336 | .maxlen = sizeof(unsigned int), | 315 | .maxlen = sizeof(unsigned int), |
@@ -352,6 +331,13 @@ static struct ctl_table kern_table[] = { | |||
352 | .proc_handler = proc_dointvec, | 331 | .proc_handler = proc_dointvec, |
353 | }, | 332 | }, |
354 | { | 333 | { |
334 | .procname = "sched_shares_window", | ||
335 | .data = &sysctl_sched_shares_window, | ||
336 | .maxlen = sizeof(unsigned int), | ||
337 | .mode = 0644, | ||
338 | .proc_handler = proc_dointvec, | ||
339 | }, | ||
340 | { | ||
355 | .procname = "timer_migration", | 341 | .procname = "timer_migration", |
356 | .data = &sysctl_timer_migration, | 342 | .data = &sysctl_timer_migration, |
357 | .maxlen = sizeof(unsigned int), | 343 | .maxlen = sizeof(unsigned int), |
@@ -382,6 +368,17 @@ static struct ctl_table kern_table[] = { | |||
382 | .mode = 0644, | 368 | .mode = 0644, |
383 | .proc_handler = proc_dointvec, | 369 | .proc_handler = proc_dointvec, |
384 | }, | 370 | }, |
371 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
372 | { | ||
373 | .procname = "sched_autogroup_enabled", | ||
374 | .data = &sysctl_sched_autogroup_enabled, | ||
375 | .maxlen = sizeof(unsigned int), | ||
376 | .mode = 0644, | ||
377 | .proc_handler = proc_dointvec, | ||
378 | .extra1 = &zero, | ||
379 | .extra2 = &one, | ||
380 | }, | ||
381 | #endif | ||
385 | #ifdef CONFIG_PROVE_LOCKING | 382 | #ifdef CONFIG_PROVE_LOCKING |
386 | { | 383 | { |
387 | .procname = "prove_locking", | 384 | .procname = "prove_locking", |
@@ -702,6 +699,24 @@ static struct ctl_table kern_table[] = { | |||
702 | .extra1 = &zero, | 699 | .extra1 = &zero, |
703 | .extra2 = &ten_thousand, | 700 | .extra2 = &ten_thousand, |
704 | }, | 701 | }, |
702 | { | ||
703 | .procname = "dmesg_restrict", | ||
704 | .data = &dmesg_restrict, | ||
705 | .maxlen = sizeof(int), | ||
706 | .mode = 0644, | ||
707 | .proc_handler = proc_dointvec_minmax, | ||
708 | .extra1 = &zero, | ||
709 | .extra2 = &one, | ||
710 | }, | ||
711 | { | ||
712 | .procname = "kptr_restrict", | ||
713 | .data = &kptr_restrict, | ||
714 | .maxlen = sizeof(int), | ||
715 | .mode = 0644, | ||
716 | .proc_handler = proc_dointvec_minmax, | ||
717 | .extra1 = &zero, | ||
718 | .extra2 = &two, | ||
719 | }, | ||
705 | #endif | 720 | #endif |
706 | { | 721 | { |
707 | .procname = "ngroups_max", | 722 | .procname = "ngroups_max", |
@@ -736,21 +751,21 @@ static struct ctl_table kern_table[] = { | |||
736 | .extra1 = &zero, | 751 | .extra1 = &zero, |
737 | .extra2 = &one, | 752 | .extra2 = &one, |
738 | }, | 753 | }, |
739 | #endif | ||
740 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) && !defined(CONFIG_LOCKUP_DETECTOR) | ||
741 | { | 754 | { |
742 | .procname = "unknown_nmi_panic", | 755 | .procname = "nmi_watchdog", |
743 | .data = &unknown_nmi_panic, | 756 | .data = &watchdog_enabled, |
744 | .maxlen = sizeof (int), | 757 | .maxlen = sizeof (int), |
745 | .mode = 0644, | 758 | .mode = 0644, |
746 | .proc_handler = proc_dointvec, | 759 | .proc_handler = proc_dowatchdog_enabled, |
747 | }, | 760 | }, |
761 | #endif | ||
762 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | ||
748 | { | 763 | { |
749 | .procname = "nmi_watchdog", | 764 | .procname = "unknown_nmi_panic", |
750 | .data = &nmi_watchdog_enabled, | 765 | .data = &unknown_nmi_panic, |
751 | .maxlen = sizeof (int), | 766 | .maxlen = sizeof (int), |
752 | .mode = 0644, | 767 | .mode = 0644, |
753 | .proc_handler = proc_nmi_enabled, | 768 | .proc_handler = proc_dointvec, |
754 | }, | 769 | }, |
755 | #endif | 770 | #endif |
756 | #if defined(CONFIG_X86) | 771 | #if defined(CONFIG_X86) |
@@ -954,10 +969,6 @@ static struct ctl_table kern_table[] = { | |||
954 | .proc_handler = proc_dointvec, | 969 | .proc_handler = proc_dointvec, |
955 | }, | 970 | }, |
956 | #endif | 971 | #endif |
957 | /* | ||
958 | * NOTE: do not add new entries to this table unless you have read | ||
959 | * Documentation/sysctl/ctl_unnumbered.txt | ||
960 | */ | ||
961 | { } | 972 | { } |
962 | }; | 973 | }; |
963 | 974 | ||
@@ -1318,11 +1329,6 @@ static struct ctl_table vm_table[] = { | |||
1318 | .extra2 = &one, | 1329 | .extra2 = &one, |
1319 | }, | 1330 | }, |
1320 | #endif | 1331 | #endif |
1321 | |||
1322 | /* | ||
1323 | * NOTE: do not add new entries to this table unless you have read | ||
1324 | * Documentation/sysctl/ctl_unnumbered.txt | ||
1325 | */ | ||
1326 | { } | 1332 | { } |
1327 | }; | 1333 | }; |
1328 | 1334 | ||
@@ -1478,10 +1484,6 @@ static struct ctl_table fs_table[] = { | |||
1478 | .proc_handler = &pipe_proc_fn, | 1484 | .proc_handler = &pipe_proc_fn, |
1479 | .extra1 = &pipe_min_size, | 1485 | .extra1 = &pipe_min_size, |
1480 | }, | 1486 | }, |
1481 | /* | ||
1482 | * NOTE: do not add new entries to this table unless you have read | ||
1483 | * Documentation/sysctl/ctl_unnumbered.txt | ||
1484 | */ | ||
1485 | { } | 1487 | { } |
1486 | }; | 1488 | }; |
1487 | 1489 | ||
@@ -2891,7 +2893,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, | |||
2891 | } | 2893 | } |
2892 | } | 2894 | } |
2893 | 2895 | ||
2894 | #else /* CONFIG_PROC_FS */ | 2896 | #else /* CONFIG_PROC_SYSCTL */ |
2895 | 2897 | ||
2896 | int proc_dostring(struct ctl_table *table, int write, | 2898 | int proc_dostring(struct ctl_table *table, int write, |
2897 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2899 | void __user *buffer, size_t *lenp, loff_t *ppos) |
@@ -2943,7 +2945,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
2943 | } | 2945 | } |
2944 | 2946 | ||
2945 | 2947 | ||
2946 | #endif /* CONFIG_PROC_FS */ | 2948 | #endif /* CONFIG_PROC_SYSCTL */ |
2947 | 2949 | ||
2948 | /* | 2950 | /* |
2949 | * No sense putting this after each symbol definition, twice, | 2951 | * No sense putting this after each symbol definition, twice, |