diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 93 |
1 files changed, 47 insertions, 46 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 3afce4dc9ba5..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> |
@@ -246,10 +247,6 @@ static struct ctl_table root_table[] = { | |||
246 | .mode = 0555, | 247 | .mode = 0555, |
247 | .child = dev_table, | 248 | .child = dev_table, |
248 | }, | 249 | }, |
249 | /* | ||
250 | * NOTE: do not add new entries to this table unless you have read | ||
251 | * Documentation/sysctl/ctl_unnumbered.txt | ||
252 | */ | ||
253 | { } | 250 | { } |
254 | }; | 251 | }; |
255 | 252 | ||
@@ -260,8 +257,6 @@ static int min_wakeup_granularity_ns; /* 0 usecs */ | |||
260 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | 257 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
261 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; | 258 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; |
262 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; | 259 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; |
263 | static int min_sched_shares_ratelimit = 100000; /* 100 usec */ | ||
264 | static int max_sched_shares_ratelimit = NSEC_PER_SEC; /* 1 second */ | ||
265 | #endif | 260 | #endif |
266 | 261 | ||
267 | #ifdef CONFIG_COMPACTION | 262 | #ifdef CONFIG_COMPACTION |
@@ -306,15 +301,6 @@ static struct ctl_table kern_table[] = { | |||
306 | .extra2 = &max_wakeup_granularity_ns, | 301 | .extra2 = &max_wakeup_granularity_ns, |
307 | }, | 302 | }, |
308 | { | 303 | { |
309 | .procname = "sched_shares_ratelimit", | ||
310 | .data = &sysctl_sched_shares_ratelimit, | ||
311 | .maxlen = sizeof(unsigned int), | ||
312 | .mode = 0644, | ||
313 | .proc_handler = sched_proc_update_handler, | ||
314 | .extra1 = &min_sched_shares_ratelimit, | ||
315 | .extra2 = &max_sched_shares_ratelimit, | ||
316 | }, | ||
317 | { | ||
318 | .procname = "sched_tunable_scaling", | 304 | .procname = "sched_tunable_scaling", |
319 | .data = &sysctl_sched_tunable_scaling, | 305 | .data = &sysctl_sched_tunable_scaling, |
320 | .maxlen = sizeof(enum sched_tunable_scaling), | 306 | .maxlen = sizeof(enum sched_tunable_scaling), |
@@ -324,14 +310,6 @@ static struct ctl_table kern_table[] = { | |||
324 | .extra2 = &max_sched_tunable_scaling, | 310 | .extra2 = &max_sched_tunable_scaling, |
325 | }, | 311 | }, |
326 | { | 312 | { |
327 | .procname = "sched_shares_thresh", | ||
328 | .data = &sysctl_sched_shares_thresh, | ||
329 | .maxlen = sizeof(unsigned int), | ||
330 | .mode = 0644, | ||
331 | .proc_handler = proc_dointvec_minmax, | ||
332 | .extra1 = &zero, | ||
333 | }, | ||
334 | { | ||
335 | .procname = "sched_migration_cost", | 313 | .procname = "sched_migration_cost", |
336 | .data = &sysctl_sched_migration_cost, | 314 | .data = &sysctl_sched_migration_cost, |
337 | .maxlen = sizeof(unsigned int), | 315 | .maxlen = sizeof(unsigned int), |
@@ -353,6 +331,13 @@ static struct ctl_table kern_table[] = { | |||
353 | .proc_handler = proc_dointvec, | 331 | .proc_handler = proc_dointvec, |
354 | }, | 332 | }, |
355 | { | 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 | { | ||
356 | .procname = "timer_migration", | 341 | .procname = "timer_migration", |
357 | .data = &sysctl_timer_migration, | 342 | .data = &sysctl_timer_migration, |
358 | .maxlen = sizeof(unsigned int), | 343 | .maxlen = sizeof(unsigned int), |
@@ -383,6 +368,17 @@ static struct ctl_table kern_table[] = { | |||
383 | .mode = 0644, | 368 | .mode = 0644, |
384 | .proc_handler = proc_dointvec, | 369 | .proc_handler = proc_dointvec, |
385 | }, | 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 | ||
386 | #ifdef CONFIG_PROVE_LOCKING | 382 | #ifdef CONFIG_PROVE_LOCKING |
387 | { | 383 | { |
388 | .procname = "prove_locking", | 384 | .procname = "prove_locking", |
@@ -703,6 +699,24 @@ static struct ctl_table kern_table[] = { | |||
703 | .extra1 = &zero, | 699 | .extra1 = &zero, |
704 | .extra2 = &ten_thousand, | 700 | .extra2 = &ten_thousand, |
705 | }, | 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 | }, | ||
706 | #endif | 720 | #endif |
707 | { | 721 | { |
708 | .procname = "ngroups_max", | 722 | .procname = "ngroups_max", |
@@ -737,21 +751,21 @@ static struct ctl_table kern_table[] = { | |||
737 | .extra1 = &zero, | 751 | .extra1 = &zero, |
738 | .extra2 = &one, | 752 | .extra2 = &one, |
739 | }, | 753 | }, |
740 | #endif | ||
741 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) && !defined(CONFIG_LOCKUP_DETECTOR) | ||
742 | { | 754 | { |
743 | .procname = "unknown_nmi_panic", | 755 | .procname = "nmi_watchdog", |
744 | .data = &unknown_nmi_panic, | 756 | .data = &watchdog_enabled, |
745 | .maxlen = sizeof (int), | 757 | .maxlen = sizeof (int), |
746 | .mode = 0644, | 758 | .mode = 0644, |
747 | .proc_handler = proc_dointvec, | 759 | .proc_handler = proc_dowatchdog_enabled, |
748 | }, | 760 | }, |
761 | #endif | ||
762 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | ||
749 | { | 763 | { |
750 | .procname = "nmi_watchdog", | 764 | .procname = "unknown_nmi_panic", |
751 | .data = &nmi_watchdog_enabled, | 765 | .data = &unknown_nmi_panic, |
752 | .maxlen = sizeof (int), | 766 | .maxlen = sizeof (int), |
753 | .mode = 0644, | 767 | .mode = 0644, |
754 | .proc_handler = proc_nmi_enabled, | 768 | .proc_handler = proc_dointvec, |
755 | }, | 769 | }, |
756 | #endif | 770 | #endif |
757 | #if defined(CONFIG_X86) | 771 | #if defined(CONFIG_X86) |
@@ -955,10 +969,6 @@ static struct ctl_table kern_table[] = { | |||
955 | .proc_handler = proc_dointvec, | 969 | .proc_handler = proc_dointvec, |
956 | }, | 970 | }, |
957 | #endif | 971 | #endif |
958 | /* | ||
959 | * NOTE: do not add new entries to this table unless you have read | ||
960 | * Documentation/sysctl/ctl_unnumbered.txt | ||
961 | */ | ||
962 | { } | 972 | { } |
963 | }; | 973 | }; |
964 | 974 | ||
@@ -1319,11 +1329,6 @@ static struct ctl_table vm_table[] = { | |||
1319 | .extra2 = &one, | 1329 | .extra2 = &one, |
1320 | }, | 1330 | }, |
1321 | #endif | 1331 | #endif |
1322 | |||
1323 | /* | ||
1324 | * NOTE: do not add new entries to this table unless you have read | ||
1325 | * Documentation/sysctl/ctl_unnumbered.txt | ||
1326 | */ | ||
1327 | { } | 1332 | { } |
1328 | }; | 1333 | }; |
1329 | 1334 | ||
@@ -1479,10 +1484,6 @@ static struct ctl_table fs_table[] = { | |||
1479 | .proc_handler = &pipe_proc_fn, | 1484 | .proc_handler = &pipe_proc_fn, |
1480 | .extra1 = &pipe_min_size, | 1485 | .extra1 = &pipe_min_size, |
1481 | }, | 1486 | }, |
1482 | /* | ||
1483 | * NOTE: do not add new entries to this table unless you have read | ||
1484 | * Documentation/sysctl/ctl_unnumbered.txt | ||
1485 | */ | ||
1486 | { } | 1487 | { } |
1487 | }; | 1488 | }; |
1488 | 1489 | ||
@@ -2892,7 +2893,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, | |||
2892 | } | 2893 | } |
2893 | } | 2894 | } |
2894 | 2895 | ||
2895 | #else /* CONFIG_PROC_FS */ | 2896 | #else /* CONFIG_PROC_SYSCTL */ |
2896 | 2897 | ||
2897 | int proc_dostring(struct ctl_table *table, int write, | 2898 | int proc_dostring(struct ctl_table *table, int write, |
2898 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2899 | void __user *buffer, size_t *lenp, loff_t *ppos) |
@@ -2944,7 +2945,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
2944 | } | 2945 | } |
2945 | 2946 | ||
2946 | 2947 | ||
2947 | #endif /* CONFIG_PROC_FS */ | 2948 | #endif /* CONFIG_PROC_SYSCTL */ |
2948 | 2949 | ||
2949 | /* | 2950 | /* |
2950 | * No sense putting this after each symbol definition, twice, | 2951 | * No sense putting this after each symbol definition, twice, |