diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 3a45c224770f..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> |
@@ -161,8 +162,6 @@ extern int no_unaligned_warning; | |||
161 | extern int unaligned_dump_stack; | 162 | extern int unaligned_dump_stack; |
162 | #endif | 163 | #endif |
163 | 164 | ||
164 | extern struct ratelimit_state printk_ratelimit_state; | ||
165 | |||
166 | #ifdef CONFIG_PROC_SYSCTL | 165 | #ifdef CONFIG_PROC_SYSCTL |
167 | static int proc_do_cad_pid(struct ctl_table *table, int write, | 166 | static int proc_do_cad_pid(struct ctl_table *table, int write, |
168 | void __user *buffer, size_t *lenp, loff_t *ppos); | 167 | void __user *buffer, size_t *lenp, loff_t *ppos); |
@@ -171,7 +170,8 @@ static int proc_taint(struct ctl_table *table, int write, | |||
171 | #endif | 170 | #endif |
172 | 171 | ||
173 | #ifdef CONFIG_MAGIC_SYSRQ | 172 | #ifdef CONFIG_MAGIC_SYSRQ |
174 | 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; | ||
175 | 175 | ||
176 | static int sysrq_sysctl_handler(ctl_table *table, int write, | 176 | static int sysrq_sysctl_handler(ctl_table *table, int write, |
177 | void __user *buffer, size_t *lenp, | 177 | void __user *buffer, size_t *lenp, |
@@ -247,10 +247,6 @@ static struct ctl_table root_table[] = { | |||
247 | .mode = 0555, | 247 | .mode = 0555, |
248 | .child = dev_table, | 248 | .child = dev_table, |
249 | }, | 249 | }, |
250 | /* | ||
251 | * NOTE: do not add new entries to this table unless you have read | ||
252 | * Documentation/sysctl/ctl_unnumbered.txt | ||
253 | */ | ||
254 | { } | 250 | { } |
255 | }; | 251 | }; |
256 | 252 | ||
@@ -261,8 +257,6 @@ static int min_wakeup_granularity_ns; /* 0 usecs */ | |||
261 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | 257 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
262 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; | 258 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; |
263 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; | 259 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; |
264 | static int min_sched_shares_ratelimit = 100000; /* 100 usec */ | ||
265 | static int max_sched_shares_ratelimit = NSEC_PER_SEC; /* 1 second */ | ||
266 | #endif | 260 | #endif |
267 | 261 | ||
268 | #ifdef CONFIG_COMPACTION | 262 | #ifdef CONFIG_COMPACTION |
@@ -307,15 +301,6 @@ static struct ctl_table kern_table[] = { | |||
307 | .extra2 = &max_wakeup_granularity_ns, | 301 | .extra2 = &max_wakeup_granularity_ns, |
308 | }, | 302 | }, |
309 | { | 303 | { |
310 | .procname = "sched_shares_ratelimit", | ||
311 | .data = &sysctl_sched_shares_ratelimit, | ||
312 | .maxlen = sizeof(unsigned int), | ||
313 | .mode = 0644, | ||
314 | .proc_handler = sched_proc_update_handler, | ||
315 | .extra1 = &min_sched_shares_ratelimit, | ||
316 | .extra2 = &max_sched_shares_ratelimit, | ||
317 | }, | ||
318 | { | ||
319 | .procname = "sched_tunable_scaling", | 304 | .procname = "sched_tunable_scaling", |
320 | .data = &sysctl_sched_tunable_scaling, | 305 | .data = &sysctl_sched_tunable_scaling, |
321 | .maxlen = sizeof(enum sched_tunable_scaling), | 306 | .maxlen = sizeof(enum sched_tunable_scaling), |
@@ -325,14 +310,6 @@ static struct ctl_table kern_table[] = { | |||
325 | .extra2 = &max_sched_tunable_scaling, | 310 | .extra2 = &max_sched_tunable_scaling, |
326 | }, | 311 | }, |
327 | { | 312 | { |
328 | .procname = "sched_shares_thresh", | ||
329 | .data = &sysctl_sched_shares_thresh, | ||
330 | .maxlen = sizeof(unsigned int), | ||
331 | .mode = 0644, | ||
332 | .proc_handler = proc_dointvec_minmax, | ||
333 | .extra1 = &zero, | ||
334 | }, | ||
335 | { | ||
336 | .procname = "sched_migration_cost", | 313 | .procname = "sched_migration_cost", |
337 | .data = &sysctl_sched_migration_cost, | 314 | .data = &sysctl_sched_migration_cost, |
338 | .maxlen = sizeof(unsigned int), | 315 | .maxlen = sizeof(unsigned int), |
@@ -354,6 +331,13 @@ static struct ctl_table kern_table[] = { | |||
354 | .proc_handler = proc_dointvec, | 331 | .proc_handler = proc_dointvec, |
355 | }, | 332 | }, |
356 | { | 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 | { | ||
357 | .procname = "timer_migration", | 341 | .procname = "timer_migration", |
358 | .data = &sysctl_timer_migration, | 342 | .data = &sysctl_timer_migration, |
359 | .maxlen = sizeof(unsigned int), | 343 | .maxlen = sizeof(unsigned int), |
@@ -384,6 +368,17 @@ static struct ctl_table kern_table[] = { | |||
384 | .mode = 0644, | 368 | .mode = 0644, |
385 | .proc_handler = proc_dointvec, | 369 | .proc_handler = proc_dointvec, |
386 | }, | 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 | ||
387 | #ifdef CONFIG_PROVE_LOCKING | 382 | #ifdef CONFIG_PROVE_LOCKING |
388 | { | 383 | { |
389 | .procname = "prove_locking", | 384 | .procname = "prove_locking", |
@@ -704,6 +699,24 @@ static struct ctl_table kern_table[] = { | |||
704 | .extra1 = &zero, | 699 | .extra1 = &zero, |
705 | .extra2 = &ten_thousand, | 700 | .extra2 = &ten_thousand, |
706 | }, | 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 | }, | ||
707 | #endif | 720 | #endif |
708 | { | 721 | { |
709 | .procname = "ngroups_max", | 722 | .procname = "ngroups_max", |
@@ -738,21 +751,21 @@ static struct ctl_table kern_table[] = { | |||
738 | .extra1 = &zero, | 751 | .extra1 = &zero, |
739 | .extra2 = &one, | 752 | .extra2 = &one, |
740 | }, | 753 | }, |
741 | #endif | ||
742 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) && !defined(CONFIG_LOCKUP_DETECTOR) | ||
743 | { | 754 | { |
744 | .procname = "unknown_nmi_panic", | 755 | .procname = "nmi_watchdog", |
745 | .data = &unknown_nmi_panic, | 756 | .data = &watchdog_enabled, |
746 | .maxlen = sizeof (int), | 757 | .maxlen = sizeof (int), |
747 | .mode = 0644, | 758 | .mode = 0644, |
748 | .proc_handler = proc_dointvec, | 759 | .proc_handler = proc_dowatchdog_enabled, |
749 | }, | 760 | }, |
761 | #endif | ||
762 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | ||
750 | { | 763 | { |
751 | .procname = "nmi_watchdog", | 764 | .procname = "unknown_nmi_panic", |
752 | .data = &nmi_watchdog_enabled, | 765 | .data = &unknown_nmi_panic, |
753 | .maxlen = sizeof (int), | 766 | .maxlen = sizeof (int), |
754 | .mode = 0644, | 767 | .mode = 0644, |
755 | .proc_handler = proc_nmi_enabled, | 768 | .proc_handler = proc_dointvec, |
756 | }, | 769 | }, |
757 | #endif | 770 | #endif |
758 | #if defined(CONFIG_X86) | 771 | #if defined(CONFIG_X86) |
@@ -956,10 +969,6 @@ static struct ctl_table kern_table[] = { | |||
956 | .proc_handler = proc_dointvec, | 969 | .proc_handler = proc_dointvec, |
957 | }, | 970 | }, |
958 | #endif | 971 | #endif |
959 | /* | ||
960 | * NOTE: do not add new entries to this table unless you have read | ||
961 | * Documentation/sysctl/ctl_unnumbered.txt | ||
962 | */ | ||
963 | { } | 972 | { } |
964 | }; | 973 | }; |
965 | 974 | ||
@@ -1320,11 +1329,6 @@ static struct ctl_table vm_table[] = { | |||
1320 | .extra2 = &one, | 1329 | .extra2 = &one, |
1321 | }, | 1330 | }, |
1322 | #endif | 1331 | #endif |
1323 | |||
1324 | /* | ||
1325 | * NOTE: do not add new entries to this table unless you have read | ||
1326 | * Documentation/sysctl/ctl_unnumbered.txt | ||
1327 | */ | ||
1328 | { } | 1332 | { } |
1329 | }; | 1333 | }; |
1330 | 1334 | ||
@@ -1340,28 +1344,28 @@ static struct ctl_table fs_table[] = { | |||
1340 | .data = &inodes_stat, | 1344 | .data = &inodes_stat, |
1341 | .maxlen = 2*sizeof(int), | 1345 | .maxlen = 2*sizeof(int), |
1342 | .mode = 0444, | 1346 | .mode = 0444, |
1343 | .proc_handler = proc_dointvec, | 1347 | .proc_handler = proc_nr_inodes, |
1344 | }, | 1348 | }, |
1345 | { | 1349 | { |
1346 | .procname = "inode-state", | 1350 | .procname = "inode-state", |
1347 | .data = &inodes_stat, | 1351 | .data = &inodes_stat, |
1348 | .maxlen = 7*sizeof(int), | 1352 | .maxlen = 7*sizeof(int), |
1349 | .mode = 0444, | 1353 | .mode = 0444, |
1350 | .proc_handler = proc_dointvec, | 1354 | .proc_handler = proc_nr_inodes, |
1351 | }, | 1355 | }, |
1352 | { | 1356 | { |
1353 | .procname = "file-nr", | 1357 | .procname = "file-nr", |
1354 | .data = &files_stat, | 1358 | .data = &files_stat, |
1355 | .maxlen = 3*sizeof(int), | 1359 | .maxlen = sizeof(files_stat), |
1356 | .mode = 0444, | 1360 | .mode = 0444, |
1357 | .proc_handler = proc_nr_files, | 1361 | .proc_handler = proc_nr_files, |
1358 | }, | 1362 | }, |
1359 | { | 1363 | { |
1360 | .procname = "file-max", | 1364 | .procname = "file-max", |
1361 | .data = &files_stat.max_files, | 1365 | .data = &files_stat.max_files, |
1362 | .maxlen = sizeof(int), | 1366 | .maxlen = sizeof(files_stat.max_files), |
1363 | .mode = 0644, | 1367 | .mode = 0644, |
1364 | .proc_handler = proc_dointvec, | 1368 | .proc_handler = proc_doulongvec_minmax, |
1365 | }, | 1369 | }, |
1366 | { | 1370 | { |
1367 | .procname = "nr_open", | 1371 | .procname = "nr_open", |
@@ -1377,7 +1381,7 @@ static struct ctl_table fs_table[] = { | |||
1377 | .data = &dentry_stat, | 1381 | .data = &dentry_stat, |
1378 | .maxlen = 6*sizeof(int), | 1382 | .maxlen = 6*sizeof(int), |
1379 | .mode = 0444, | 1383 | .mode = 0444, |
1380 | .proc_handler = proc_dointvec, | 1384 | .proc_handler = proc_nr_dentry, |
1381 | }, | 1385 | }, |
1382 | { | 1386 | { |
1383 | .procname = "overflowuid", | 1387 | .procname = "overflowuid", |
@@ -1480,10 +1484,6 @@ static struct ctl_table fs_table[] = { | |||
1480 | .proc_handler = &pipe_proc_fn, | 1484 | .proc_handler = &pipe_proc_fn, |
1481 | .extra1 = &pipe_min_size, | 1485 | .extra1 = &pipe_min_size, |
1482 | }, | 1486 | }, |
1483 | /* | ||
1484 | * NOTE: do not add new entries to this table unless you have read | ||
1485 | * Documentation/sysctl/ctl_unnumbered.txt | ||
1486 | */ | ||
1487 | { } | 1487 | { } |
1488 | }; | 1488 | }; |
1489 | 1489 | ||
@@ -2893,7 +2893,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, | |||
2893 | } | 2893 | } |
2894 | } | 2894 | } |
2895 | 2895 | ||
2896 | #else /* CONFIG_PROC_FS */ | 2896 | #else /* CONFIG_PROC_SYSCTL */ |
2897 | 2897 | ||
2898 | int proc_dostring(struct ctl_table *table, int write, | 2898 | int proc_dostring(struct ctl_table *table, int write, |
2899 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2899 | void __user *buffer, size_t *lenp, loff_t *ppos) |
@@ -2945,7 +2945,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
2945 | } | 2945 | } |
2946 | 2946 | ||
2947 | 2947 | ||
2948 | #endif /* CONFIG_PROC_FS */ | 2948 | #endif /* CONFIG_PROC_SYSCTL */ |
2949 | 2949 | ||
2950 | /* | 2950 | /* |
2951 | * No sense putting this after each symbol definition, twice, | 2951 | * No sense putting this after each symbol definition, twice, |