diff options
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 87 |
1 files changed, 40 insertions, 47 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 5abfa1518554..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", |
| @@ -711,6 +708,15 @@ static struct ctl_table kern_table[] = { | |||
| 711 | .extra1 = &zero, | 708 | .extra1 = &zero, |
| 712 | .extra2 = &one, | 709 | .extra2 = &one, |
| 713 | }, | 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 | }, | ||
| 714 | #endif | 720 | #endif |
| 715 | { | 721 | { |
| 716 | .procname = "ngroups_max", | 722 | .procname = "ngroups_max", |
| @@ -745,21 +751,21 @@ static struct ctl_table kern_table[] = { | |||
| 745 | .extra1 = &zero, | 751 | .extra1 = &zero, |
| 746 | .extra2 = &one, | 752 | .extra2 = &one, |
| 747 | }, | 753 | }, |
| 748 | #endif | ||
| 749 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) && !defined(CONFIG_LOCKUP_DETECTOR) | ||
| 750 | { | 754 | { |
| 751 | .procname = "unknown_nmi_panic", | 755 | .procname = "nmi_watchdog", |
| 752 | .data = &unknown_nmi_panic, | 756 | .data = &watchdog_enabled, |
| 753 | .maxlen = sizeof (int), | 757 | .maxlen = sizeof (int), |
| 754 | .mode = 0644, | 758 | .mode = 0644, |
| 755 | .proc_handler = proc_dointvec, | 759 | .proc_handler = proc_dowatchdog_enabled, |
| 756 | }, | 760 | }, |
| 761 | #endif | ||
| 762 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | ||
| 757 | { | 763 | { |
| 758 | .procname = "nmi_watchdog", | 764 | .procname = "unknown_nmi_panic", |
| 759 | .data = &nmi_watchdog_enabled, | 765 | .data = &unknown_nmi_panic, |
| 760 | .maxlen = sizeof (int), | 766 | .maxlen = sizeof (int), |
| 761 | .mode = 0644, | 767 | .mode = 0644, |
| 762 | .proc_handler = proc_nmi_enabled, | 768 | .proc_handler = proc_dointvec, |
| 763 | }, | 769 | }, |
| 764 | #endif | 770 | #endif |
| 765 | #if defined(CONFIG_X86) | 771 | #if defined(CONFIG_X86) |
| @@ -963,10 +969,6 @@ static struct ctl_table kern_table[] = { | |||
| 963 | .proc_handler = proc_dointvec, | 969 | .proc_handler = proc_dointvec, |
| 964 | }, | 970 | }, |
| 965 | #endif | 971 | #endif |
| 966 | /* | ||
| 967 | * NOTE: do not add new entries to this table unless you have read | ||
| 968 | * Documentation/sysctl/ctl_unnumbered.txt | ||
| 969 | */ | ||
| 970 | { } | 972 | { } |
| 971 | }; | 973 | }; |
| 972 | 974 | ||
| @@ -1327,11 +1329,6 @@ static struct ctl_table vm_table[] = { | |||
| 1327 | .extra2 = &one, | 1329 | .extra2 = &one, |
| 1328 | }, | 1330 | }, |
| 1329 | #endif | 1331 | #endif |
| 1330 | |||
| 1331 | /* | ||
| 1332 | * NOTE: do not add new entries to this table unless you have read | ||
| 1333 | * Documentation/sysctl/ctl_unnumbered.txt | ||
| 1334 | */ | ||
| 1335 | { } | 1332 | { } |
| 1336 | }; | 1333 | }; |
| 1337 | 1334 | ||
| @@ -1487,10 +1484,6 @@ static struct ctl_table fs_table[] = { | |||
| 1487 | .proc_handler = &pipe_proc_fn, | 1484 | .proc_handler = &pipe_proc_fn, |
| 1488 | .extra1 = &pipe_min_size, | 1485 | .extra1 = &pipe_min_size, |
| 1489 | }, | 1486 | }, |
| 1490 | /* | ||
| 1491 | * NOTE: do not add new entries to this table unless you have read | ||
| 1492 | * Documentation/sysctl/ctl_unnumbered.txt | ||
| 1493 | */ | ||
| 1494 | { } | 1487 | { } |
| 1495 | }; | 1488 | }; |
| 1496 | 1489 | ||
| @@ -2900,7 +2893,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, | |||
| 2900 | } | 2893 | } |
| 2901 | } | 2894 | } |
| 2902 | 2895 | ||
| 2903 | #else /* CONFIG_PROC_FS */ | 2896 | #else /* CONFIG_PROC_SYSCTL */ |
| 2904 | 2897 | ||
| 2905 | int proc_dostring(struct ctl_table *table, int write, | 2898 | int proc_dostring(struct ctl_table *table, int write, |
| 2906 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2899 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| @@ -2952,7 +2945,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
| 2952 | } | 2945 | } |
| 2953 | 2946 | ||
| 2954 | 2947 | ||
| 2955 | #endif /* CONFIG_PROC_FS */ | 2948 | #endif /* CONFIG_PROC_SYSCTL */ |
| 2956 | 2949 | ||
| 2957 | /* | 2950 | /* |
| 2958 | * No sense putting this after each symbol definition, twice, | 2951 | * No sense putting this after each symbol definition, twice, |
