diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 77 |
1 files changed, 51 insertions, 26 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index b3ce58137303..0e51a35a4486 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/reboot.h> | 49 | #include <linux/reboot.h> |
50 | #include <linux/ftrace.h> | 50 | #include <linux/ftrace.h> |
51 | #include <linux/slow-work.h> | 51 | #include <linux/slow-work.h> |
52 | #include <linux/perf_counter.h> | ||
52 | 53 | ||
53 | #include <asm/uaccess.h> | 54 | #include <asm/uaccess.h> |
54 | #include <asm/processor.h> | 55 | #include <asm/processor.h> |
@@ -101,7 +102,9 @@ static int __maybe_unused one = 1; | |||
101 | static int __maybe_unused two = 2; | 102 | static int __maybe_unused two = 2; |
102 | static unsigned long one_ul = 1; | 103 | static unsigned long one_ul = 1; |
103 | static int one_hundred = 100; | 104 | static int one_hundred = 100; |
104 | static int one_thousand = 1000; | 105 | |
106 | /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ | ||
107 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; | ||
105 | 108 | ||
106 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ | 109 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ |
107 | static int maxolduid = 65535; | 110 | static int maxolduid = 65535; |
@@ -112,6 +115,7 @@ static int ngroups_max = NGROUPS_MAX; | |||
112 | 115 | ||
113 | #ifdef CONFIG_MODULES | 116 | #ifdef CONFIG_MODULES |
114 | extern char modprobe_path[]; | 117 | extern char modprobe_path[]; |
118 | extern int modules_disabled; | ||
115 | #endif | 119 | #endif |
116 | #ifdef CONFIG_CHR_DEV_SG | 120 | #ifdef CONFIG_CHR_DEV_SG |
117 | extern int sg_big_buff; | 121 | extern int sg_big_buff; |
@@ -540,6 +544,17 @@ static struct ctl_table kern_table[] = { | |||
540 | .proc_handler = &proc_dostring, | 544 | .proc_handler = &proc_dostring, |
541 | .strategy = &sysctl_string, | 545 | .strategy = &sysctl_string, |
542 | }, | 546 | }, |
547 | { | ||
548 | .ctl_name = CTL_UNNUMBERED, | ||
549 | .procname = "modules_disabled", | ||
550 | .data = &modules_disabled, | ||
551 | .maxlen = sizeof(int), | ||
552 | .mode = 0644, | ||
553 | /* only handle a transition from default "0" to "1" */ | ||
554 | .proc_handler = &proc_dointvec_minmax, | ||
555 | .extra1 = &one, | ||
556 | .extra2 = &one, | ||
557 | }, | ||
543 | #endif | 558 | #endif |
544 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 559 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
545 | { | 560 | { |
@@ -737,6 +752,14 @@ static struct ctl_table kern_table[] = { | |||
737 | }, | 752 | }, |
738 | { | 753 | { |
739 | .ctl_name = CTL_UNNUMBERED, | 754 | .ctl_name = CTL_UNNUMBERED, |
755 | .procname = "bootloader_version", | ||
756 | .data = &bootloader_version, | ||
757 | .maxlen = sizeof (int), | ||
758 | .mode = 0444, | ||
759 | .proc_handler = &proc_dointvec, | ||
760 | }, | ||
761 | { | ||
762 | .ctl_name = CTL_UNNUMBERED, | ||
740 | .procname = "kstack_depth_to_print", | 763 | .procname = "kstack_depth_to_print", |
741 | .data = &kstack_depth_to_print, | 764 | .data = &kstack_depth_to_print, |
742 | .maxlen = sizeof(int), | 765 | .maxlen = sizeof(int), |
@@ -918,6 +941,32 @@ static struct ctl_table kern_table[] = { | |||
918 | .child = slow_work_sysctls, | 941 | .child = slow_work_sysctls, |
919 | }, | 942 | }, |
920 | #endif | 943 | #endif |
944 | #ifdef CONFIG_PERF_COUNTERS | ||
945 | { | ||
946 | .ctl_name = CTL_UNNUMBERED, | ||
947 | .procname = "perf_counter_paranoid", | ||
948 | .data = &sysctl_perf_counter_paranoid, | ||
949 | .maxlen = sizeof(sysctl_perf_counter_paranoid), | ||
950 | .mode = 0644, | ||
951 | .proc_handler = &proc_dointvec, | ||
952 | }, | ||
953 | { | ||
954 | .ctl_name = CTL_UNNUMBERED, | ||
955 | .procname = "perf_counter_mlock_kb", | ||
956 | .data = &sysctl_perf_counter_mlock, | ||
957 | .maxlen = sizeof(sysctl_perf_counter_mlock), | ||
958 | .mode = 0644, | ||
959 | .proc_handler = &proc_dointvec, | ||
960 | }, | ||
961 | { | ||
962 | .ctl_name = CTL_UNNUMBERED, | ||
963 | .procname = "perf_counter_max_sample_rate", | ||
964 | .data = &sysctl_perf_counter_sample_rate, | ||
965 | .maxlen = sizeof(sysctl_perf_counter_sample_rate), | ||
966 | .mode = 0644, | ||
967 | .proc_handler = &proc_dointvec, | ||
968 | }, | ||
969 | #endif | ||
921 | /* | 970 | /* |
922 | * NOTE: do not add new entries to this table unless you have read | 971 | * NOTE: do not add new entries to this table unless you have read |
923 | * Documentation/sysctl/ctl_unnumbered.txt | 972 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -1014,7 +1063,7 @@ static struct ctl_table vm_table[] = { | |||
1014 | .mode = 0644, | 1063 | .mode = 0644, |
1015 | .proc_handler = &dirty_bytes_handler, | 1064 | .proc_handler = &dirty_bytes_handler, |
1016 | .strategy = &sysctl_intvec, | 1065 | .strategy = &sysctl_intvec, |
1017 | .extra1 = &one_ul, | 1066 | .extra1 = &dirty_bytes_min, |
1018 | }, | 1067 | }, |
1019 | { | 1068 | { |
1020 | .procname = "dirty_writeback_centisecs", | 1069 | .procname = "dirty_writeback_centisecs", |
@@ -1039,28 +1088,6 @@ static struct ctl_table vm_table[] = { | |||
1039 | .proc_handler = &proc_dointvec, | 1088 | .proc_handler = &proc_dointvec, |
1040 | }, | 1089 | }, |
1041 | { | 1090 | { |
1042 | .ctl_name = CTL_UNNUMBERED, | ||
1043 | .procname = "nr_pdflush_threads_min", | ||
1044 | .data = &nr_pdflush_threads_min, | ||
1045 | .maxlen = sizeof nr_pdflush_threads_min, | ||
1046 | .mode = 0644 /* read-write */, | ||
1047 | .proc_handler = &proc_dointvec_minmax, | ||
1048 | .strategy = &sysctl_intvec, | ||
1049 | .extra1 = &one, | ||
1050 | .extra2 = &nr_pdflush_threads_max, | ||
1051 | }, | ||
1052 | { | ||
1053 | .ctl_name = CTL_UNNUMBERED, | ||
1054 | .procname = "nr_pdflush_threads_max", | ||
1055 | .data = &nr_pdflush_threads_max, | ||
1056 | .maxlen = sizeof nr_pdflush_threads_max, | ||
1057 | .mode = 0644 /* read-write */, | ||
1058 | .proc_handler = &proc_dointvec_minmax, | ||
1059 | .strategy = &sysctl_intvec, | ||
1060 | .extra1 = &nr_pdflush_threads_min, | ||
1061 | .extra2 = &one_thousand, | ||
1062 | }, | ||
1063 | { | ||
1064 | .ctl_name = VM_SWAPPINESS, | 1091 | .ctl_name = VM_SWAPPINESS, |
1065 | .procname = "swappiness", | 1092 | .procname = "swappiness", |
1066 | .data = &vm_swappiness, | 1093 | .data = &vm_swappiness, |
@@ -1253,7 +1280,6 @@ static struct ctl_table vm_table[] = { | |||
1253 | .strategy = &sysctl_jiffies, | 1280 | .strategy = &sysctl_jiffies, |
1254 | }, | 1281 | }, |
1255 | #endif | 1282 | #endif |
1256 | #ifdef CONFIG_SECURITY | ||
1257 | { | 1283 | { |
1258 | .ctl_name = CTL_UNNUMBERED, | 1284 | .ctl_name = CTL_UNNUMBERED, |
1259 | .procname = "mmap_min_addr", | 1285 | .procname = "mmap_min_addr", |
@@ -1262,7 +1288,6 @@ static struct ctl_table vm_table[] = { | |||
1262 | .mode = 0644, | 1288 | .mode = 0644, |
1263 | .proc_handler = &proc_doulongvec_minmax, | 1289 | .proc_handler = &proc_doulongvec_minmax, |
1264 | }, | 1290 | }, |
1265 | #endif | ||
1266 | #ifdef CONFIG_NUMA | 1291 | #ifdef CONFIG_NUMA |
1267 | { | 1292 | { |
1268 | .ctl_name = CTL_UNNUMBERED, | 1293 | .ctl_name = CTL_UNNUMBERED, |