diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index b53115b882e1..cb99a42f8b37 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -25,12 +25,14 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/sysctl.h> | 26 | #include <linux/sysctl.h> |
27 | #include <linux/proc_fs.h> | 27 | #include <linux/proc_fs.h> |
28 | #include <linux/capability.h> | ||
28 | #include <linux/ctype.h> | 29 | #include <linux/ctype.h> |
29 | #include <linux/utsname.h> | 30 | #include <linux/utsname.h> |
30 | #include <linux/capability.h> | 31 | #include <linux/capability.h> |
31 | #include <linux/smp_lock.h> | 32 | #include <linux/smp_lock.h> |
32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
33 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | #include <linux/kobject.h> | ||
34 | #include <linux/net.h> | 36 | #include <linux/net.h> |
35 | #include <linux/sysrq.h> | 37 | #include <linux/sysrq.h> |
36 | #include <linux/highuid.h> | 38 | #include <linux/highuid.h> |
@@ -67,6 +69,8 @@ extern int min_free_kbytes; | |||
67 | extern int printk_ratelimit_jiffies; | 69 | extern int printk_ratelimit_jiffies; |
68 | extern int printk_ratelimit_burst; | 70 | extern int printk_ratelimit_burst; |
69 | extern int pid_max_min, pid_max_max; | 71 | extern int pid_max_min, pid_max_max; |
72 | extern int sysctl_drop_caches; | ||
73 | extern int percpu_pagelist_fraction; | ||
70 | 74 | ||
71 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | 75 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) |
72 | int unknown_nmi_panic; | 76 | int unknown_nmi_panic; |
@@ -77,15 +81,13 @@ extern int proc_unknown_nmi_panic(ctl_table *, int, struct file *, | |||
77 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ | 81 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ |
78 | static int maxolduid = 65535; | 82 | static int maxolduid = 65535; |
79 | static int minolduid; | 83 | static int minolduid; |
84 | static int min_percpu_pagelist_fract = 8; | ||
80 | 85 | ||
81 | static int ngroups_max = NGROUPS_MAX; | 86 | static int ngroups_max = NGROUPS_MAX; |
82 | 87 | ||
83 | #ifdef CONFIG_KMOD | 88 | #ifdef CONFIG_KMOD |
84 | extern char modprobe_path[]; | 89 | extern char modprobe_path[]; |
85 | #endif | 90 | #endif |
86 | #ifdef CONFIG_HOTPLUG | ||
87 | extern char hotplug_path[]; | ||
88 | #endif | ||
89 | #ifdef CONFIG_CHR_DEV_SG | 91 | #ifdef CONFIG_CHR_DEV_SG |
90 | extern int sg_big_buff; | 92 | extern int sg_big_buff; |
91 | #endif | 93 | #endif |
@@ -110,7 +112,7 @@ extern int pwrsw_enabled; | |||
110 | extern int unaligned_enabled; | 112 | extern int unaligned_enabled; |
111 | #endif | 113 | #endif |
112 | 114 | ||
113 | #ifdef CONFIG_ARCH_S390 | 115 | #ifdef CONFIG_S390 |
114 | #ifdef CONFIG_MATHEMU | 116 | #ifdef CONFIG_MATHEMU |
115 | extern int sysctl_ieee_emulation_warnings; | 117 | extern int sysctl_ieee_emulation_warnings; |
116 | #endif | 118 | #endif |
@@ -397,8 +399,8 @@ static ctl_table kern_table[] = { | |||
397 | { | 399 | { |
398 | .ctl_name = KERN_HOTPLUG, | 400 | .ctl_name = KERN_HOTPLUG, |
399 | .procname = "hotplug", | 401 | .procname = "hotplug", |
400 | .data = &hotplug_path, | 402 | .data = &uevent_helper, |
401 | .maxlen = HOTPLUG_PATH_LEN, | 403 | .maxlen = UEVENT_HELPER_PATH_LEN, |
402 | .mode = 0644, | 404 | .mode = 0644, |
403 | .proc_handler = &proc_dostring, | 405 | .proc_handler = &proc_dostring, |
404 | .strategy = &sysctl_string, | 406 | .strategy = &sysctl_string, |
@@ -544,7 +546,7 @@ static ctl_table kern_table[] = { | |||
544 | .extra1 = &minolduid, | 546 | .extra1 = &minolduid, |
545 | .extra2 = &maxolduid, | 547 | .extra2 = &maxolduid, |
546 | }, | 548 | }, |
547 | #ifdef CONFIG_ARCH_S390 | 549 | #ifdef CONFIG_S390 |
548 | #ifdef CONFIG_MATHEMU | 550 | #ifdef CONFIG_MATHEMU |
549 | { | 551 | { |
550 | .ctl_name = KERN_IEEE_EMULATION_WARNINGS, | 552 | .ctl_name = KERN_IEEE_EMULATION_WARNINGS, |
@@ -646,7 +648,7 @@ static ctl_table kern_table[] = { | |||
646 | .mode = 0644, | 648 | .mode = 0644, |
647 | .proc_handler = &proc_dointvec, | 649 | .proc_handler = &proc_dointvec, |
648 | }, | 650 | }, |
649 | #if defined(CONFIG_ARCH_S390) | 651 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) |
650 | { | 652 | { |
651 | .ctl_name = KERN_SPIN_RETRY, | 653 | .ctl_name = KERN_SPIN_RETRY, |
652 | .procname = "spin_retry", | 654 | .procname = "spin_retry", |
@@ -777,6 +779,15 @@ static ctl_table vm_table[] = { | |||
777 | .strategy = &sysctl_intvec, | 779 | .strategy = &sysctl_intvec, |
778 | }, | 780 | }, |
779 | { | 781 | { |
782 | .ctl_name = VM_DROP_PAGECACHE, | ||
783 | .procname = "drop_caches", | ||
784 | .data = &sysctl_drop_caches, | ||
785 | .maxlen = sizeof(int), | ||
786 | .mode = 0644, | ||
787 | .proc_handler = drop_caches_sysctl_handler, | ||
788 | .strategy = &sysctl_intvec, | ||
789 | }, | ||
790 | { | ||
780 | .ctl_name = VM_MIN_FREE_KBYTES, | 791 | .ctl_name = VM_MIN_FREE_KBYTES, |
781 | .procname = "min_free_kbytes", | 792 | .procname = "min_free_kbytes", |
782 | .data = &min_free_kbytes, | 793 | .data = &min_free_kbytes, |
@@ -786,6 +797,16 @@ static ctl_table vm_table[] = { | |||
786 | .strategy = &sysctl_intvec, | 797 | .strategy = &sysctl_intvec, |
787 | .extra1 = &zero, | 798 | .extra1 = &zero, |
788 | }, | 799 | }, |
800 | { | ||
801 | .ctl_name = VM_PERCPU_PAGELIST_FRACTION, | ||
802 | .procname = "percpu_pagelist_fraction", | ||
803 | .data = &percpu_pagelist_fraction, | ||
804 | .maxlen = sizeof(percpu_pagelist_fraction), | ||
805 | .mode = 0644, | ||
806 | .proc_handler = &percpu_pagelist_fraction_sysctl_handler, | ||
807 | .strategy = &sysctl_intvec, | ||
808 | .extra1 = &min_percpu_pagelist_fract, | ||
809 | }, | ||
789 | #ifdef CONFIG_MMU | 810 | #ifdef CONFIG_MMU |
790 | { | 811 | { |
791 | .ctl_name = VM_MAX_MAP_COUNT, | 812 | .ctl_name = VM_MAX_MAP_COUNT, |
@@ -849,6 +870,17 @@ static ctl_table vm_table[] = { | |||
849 | .strategy = &sysctl_jiffies, | 870 | .strategy = &sysctl_jiffies, |
850 | }, | 871 | }, |
851 | #endif | 872 | #endif |
873 | #ifdef CONFIG_NUMA | ||
874 | { | ||
875 | .ctl_name = VM_ZONE_RECLAIM_MODE, | ||
876 | .procname = "zone_reclaim_mode", | ||
877 | .data = &zone_reclaim_mode, | ||
878 | .maxlen = sizeof(zone_reclaim_mode), | ||
879 | .mode = 0644, | ||
880 | .proc_handler = &proc_dointvec, | ||
881 | .strategy = &zero, | ||
882 | }, | ||
883 | #endif | ||
852 | { .ctl_name = 0 } | 884 | { .ctl_name = 0 } |
853 | }; | 885 | }; |
854 | 886 | ||