aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c77
1 files changed, 51 insertions, 26 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index e3d2c7dd59b9..ce664f98e3fb 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;
101static int __maybe_unused two = 2; 102static int __maybe_unused two = 2;
102static unsigned long one_ul = 1; 103static unsigned long one_ul = 1;
103static int one_hundred = 100; 104static int one_hundred = 100;
104static int one_thousand = 1000; 105
106/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
107static 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 */
107static int maxolduid = 65535; 110static int maxolduid = 65535;
@@ -112,6 +115,7 @@ static int ngroups_max = NGROUPS_MAX;
112 115
113#ifdef CONFIG_MODULES 116#ifdef CONFIG_MODULES
114extern char modprobe_path[]; 117extern char modprobe_path[];
118extern int modules_disabled;
115#endif 119#endif
116#ifdef CONFIG_CHR_DEV_SG 120#ifdef CONFIG_CHR_DEV_SG
117extern int sg_big_buff; 121extern int sg_big_buff;
@@ -532,6 +536,17 @@ static struct ctl_table kern_table[] = {
532 .proc_handler = &proc_dostring, 536 .proc_handler = &proc_dostring,
533 .strategy = &sysctl_string, 537 .strategy = &sysctl_string,
534 }, 538 },
539 {
540 .ctl_name = CTL_UNNUMBERED,
541 .procname = "modules_disabled",
542 .data = &modules_disabled,
543 .maxlen = sizeof(int),
544 .mode = 0644,
545 /* only handle a transition from default "0" to "1" */
546 .proc_handler = &proc_dointvec_minmax,
547 .extra1 = &one,
548 .extra2 = &one,
549 },
535#endif 550#endif
536#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 551#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
537 { 552 {
@@ -729,6 +744,14 @@ static struct ctl_table kern_table[] = {
729 }, 744 },
730 { 745 {
731 .ctl_name = CTL_UNNUMBERED, 746 .ctl_name = CTL_UNNUMBERED,
747 .procname = "bootloader_version",
748 .data = &bootloader_version,
749 .maxlen = sizeof (int),
750 .mode = 0444,
751 .proc_handler = &proc_dointvec,
752 },
753 {
754 .ctl_name = CTL_UNNUMBERED,
732 .procname = "kstack_depth_to_print", 755 .procname = "kstack_depth_to_print",
733 .data = &kstack_depth_to_print, 756 .data = &kstack_depth_to_print,
734 .maxlen = sizeof(int), 757 .maxlen = sizeof(int),
@@ -910,6 +933,32 @@ static struct ctl_table kern_table[] = {
910 .child = slow_work_sysctls, 933 .child = slow_work_sysctls,
911 }, 934 },
912#endif 935#endif
936#ifdef CONFIG_PERF_COUNTERS
937 {
938 .ctl_name = CTL_UNNUMBERED,
939 .procname = "perf_counter_paranoid",
940 .data = &sysctl_perf_counter_paranoid,
941 .maxlen = sizeof(sysctl_perf_counter_paranoid),
942 .mode = 0644,
943 .proc_handler = &proc_dointvec,
944 },
945 {
946 .ctl_name = CTL_UNNUMBERED,
947 .procname = "perf_counter_mlock_kb",
948 .data = &sysctl_perf_counter_mlock,
949 .maxlen = sizeof(sysctl_perf_counter_mlock),
950 .mode = 0644,
951 .proc_handler = &proc_dointvec,
952 },
953 {
954 .ctl_name = CTL_UNNUMBERED,
955 .procname = "perf_counter_max_sample_rate",
956 .data = &sysctl_perf_counter_sample_rate,
957 .maxlen = sizeof(sysctl_perf_counter_sample_rate),
958 .mode = 0644,
959 .proc_handler = &proc_dointvec,
960 },
961#endif
913/* 962/*
914 * NOTE: do not add new entries to this table unless you have read 963 * NOTE: do not add new entries to this table unless you have read
915 * Documentation/sysctl/ctl_unnumbered.txt 964 * Documentation/sysctl/ctl_unnumbered.txt
@@ -1006,7 +1055,7 @@ static struct ctl_table vm_table[] = {
1006 .mode = 0644, 1055 .mode = 0644,
1007 .proc_handler = &dirty_bytes_handler, 1056 .proc_handler = &dirty_bytes_handler,
1008 .strategy = &sysctl_intvec, 1057 .strategy = &sysctl_intvec,
1009 .extra1 = &one_ul, 1058 .extra1 = &dirty_bytes_min,
1010 }, 1059 },
1011 { 1060 {
1012 .procname = "dirty_writeback_centisecs", 1061 .procname = "dirty_writeback_centisecs",
@@ -1031,28 +1080,6 @@ static struct ctl_table vm_table[] = {
1031 .proc_handler = &proc_dointvec, 1080 .proc_handler = &proc_dointvec,
1032 }, 1081 },
1033 { 1082 {
1034 .ctl_name = CTL_UNNUMBERED,
1035 .procname = "nr_pdflush_threads_min",
1036 .data = &nr_pdflush_threads_min,
1037 .maxlen = sizeof nr_pdflush_threads_min,
1038 .mode = 0644 /* read-write */,
1039 .proc_handler = &proc_dointvec_minmax,
1040 .strategy = &sysctl_intvec,
1041 .extra1 = &one,
1042 .extra2 = &nr_pdflush_threads_max,
1043 },
1044 {
1045 .ctl_name = CTL_UNNUMBERED,
1046 .procname = "nr_pdflush_threads_max",
1047 .data = &nr_pdflush_threads_max,
1048 .maxlen = sizeof nr_pdflush_threads_max,
1049 .mode = 0644 /* read-write */,
1050 .proc_handler = &proc_dointvec_minmax,
1051 .strategy = &sysctl_intvec,
1052 .extra1 = &nr_pdflush_threads_min,
1053 .extra2 = &one_thousand,
1054 },
1055 {
1056 .ctl_name = VM_SWAPPINESS, 1083 .ctl_name = VM_SWAPPINESS,
1057 .procname = "swappiness", 1084 .procname = "swappiness",
1058 .data = &vm_swappiness, 1085 .data = &vm_swappiness,
@@ -1245,7 +1272,6 @@ static struct ctl_table vm_table[] = {
1245 .strategy = &sysctl_jiffies, 1272 .strategy = &sysctl_jiffies,
1246 }, 1273 },
1247#endif 1274#endif
1248#ifdef CONFIG_SECURITY
1249 { 1275 {
1250 .ctl_name = CTL_UNNUMBERED, 1276 .ctl_name = CTL_UNNUMBERED,
1251 .procname = "mmap_min_addr", 1277 .procname = "mmap_min_addr",
@@ -1254,7 +1280,6 @@ static struct ctl_table vm_table[] = {
1254 .mode = 0644, 1280 .mode = 0644,
1255 .proc_handler = &proc_doulongvec_minmax, 1281 .proc_handler = &proc_doulongvec_minmax,
1256 }, 1282 },
1257#endif
1258#ifdef CONFIG_NUMA 1283#ifdef CONFIG_NUMA
1259 { 1284 {
1260 .ctl_name = CTL_UNNUMBERED, 1285 .ctl_name = CTL_UNNUMBERED,