aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c72
1 files changed, 47 insertions, 25 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ea78fa101ad6..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,6 @@ 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 105
106/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ 106/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
107static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; 107static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
@@ -115,6 +115,7 @@ static int ngroups_max = NGROUPS_MAX;
115 115
116#ifdef CONFIG_MODULES 116#ifdef CONFIG_MODULES
117extern char modprobe_path[]; 117extern char modprobe_path[];
118extern int modules_disabled;
118#endif 119#endif
119#ifdef CONFIG_CHR_DEV_SG 120#ifdef CONFIG_CHR_DEV_SG
120extern int sg_big_buff; 121extern int sg_big_buff;
@@ -535,6 +536,17 @@ static struct ctl_table kern_table[] = {
535 .proc_handler = &proc_dostring, 536 .proc_handler = &proc_dostring,
536 .strategy = &sysctl_string, 537 .strategy = &sysctl_string,
537 }, 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 },
538#endif 550#endif
539#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 551#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
540 { 552 {
@@ -732,6 +744,14 @@ static struct ctl_table kern_table[] = {
732 }, 744 },
733 { 745 {
734 .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,
735 .procname = "kstack_depth_to_print", 755 .procname = "kstack_depth_to_print",
736 .data = &kstack_depth_to_print, 756 .data = &kstack_depth_to_print,
737 .maxlen = sizeof(int), 757 .maxlen = sizeof(int),
@@ -913,6 +933,32 @@ static struct ctl_table kern_table[] = {
913 .child = slow_work_sysctls, 933 .child = slow_work_sysctls,
914 }, 934 },
915#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
916/* 962/*
917 * 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
918 * Documentation/sysctl/ctl_unnumbered.txt 964 * Documentation/sysctl/ctl_unnumbered.txt
@@ -1034,28 +1080,6 @@ static struct ctl_table vm_table[] = {
1034 .proc_handler = &proc_dointvec, 1080 .proc_handler = &proc_dointvec,
1035 }, 1081 },
1036 { 1082 {
1037 .ctl_name = CTL_UNNUMBERED,
1038 .procname = "nr_pdflush_threads_min",
1039 .data = &nr_pdflush_threads_min,
1040 .maxlen = sizeof nr_pdflush_threads_min,
1041 .mode = 0644 /* read-write */,
1042 .proc_handler = &proc_dointvec_minmax,
1043 .strategy = &sysctl_intvec,
1044 .extra1 = &one,
1045 .extra2 = &nr_pdflush_threads_max,
1046 },
1047 {
1048 .ctl_name = CTL_UNNUMBERED,
1049 .procname = "nr_pdflush_threads_max",
1050 .data = &nr_pdflush_threads_max,
1051 .maxlen = sizeof nr_pdflush_threads_max,
1052 .mode = 0644 /* read-write */,
1053 .proc_handler = &proc_dointvec_minmax,
1054 .strategy = &sysctl_intvec,
1055 .extra1 = &nr_pdflush_threads_min,
1056 .extra2 = &one_thousand,
1057 },
1058 {
1059 .ctl_name = VM_SWAPPINESS, 1083 .ctl_name = VM_SWAPPINESS,
1060 .procname = "swappiness", 1084 .procname = "swappiness",
1061 .data = &vm_swappiness, 1085 .data = &vm_swappiness,
@@ -1248,7 +1272,6 @@ static struct ctl_table vm_table[] = {
1248 .strategy = &sysctl_jiffies, 1272 .strategy = &sysctl_jiffies,
1249 }, 1273 },
1250#endif 1274#endif
1251#ifdef CONFIG_SECURITY
1252 { 1275 {
1253 .ctl_name = CTL_UNNUMBERED, 1276 .ctl_name = CTL_UNNUMBERED,
1254 .procname = "mmap_min_addr", 1277 .procname = "mmap_min_addr",
@@ -1257,7 +1280,6 @@ static struct ctl_table vm_table[] = {
1257 .mode = 0644, 1280 .mode = 0644,
1258 .proc_handler = &proc_doulongvec_minmax, 1281 .proc_handler = &proc_doulongvec_minmax,
1259 }, 1282 },
1260#endif
1261#ifdef CONFIG_NUMA 1283#ifdef CONFIG_NUMA
1262 { 1284 {
1263 .ctl_name = CTL_UNNUMBERED, 1285 .ctl_name = CTL_UNNUMBERED,