rcu: Fix rcu_lock_map build failure on CONFIG_PROVE_LOCKING=y
[safe/jmp/linux-2.6] / kernel / sysctl.c
index 8ba4578..1a631ba 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/security.h>
 #include <linux/ctype.h>
 #include <linux/utsname.h>
+#include <linux/kmemcheck.h>
 #include <linux/smp_lock.h>
 #include <linux/fs.h>
 #include <linux/init.h>
@@ -90,6 +91,9 @@ extern int sysctl_nr_trim_pages;
 #ifdef CONFIG_RCU_TORTURE_TEST
 extern int rcutorture_runnable;
 #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
+#ifdef CONFIG_BLOCK
+extern int blk_iopoll_enabled;
+#endif
 
 /* Constants used for minimum and  maximum */
 #ifdef CONFIG_DETECT_SOFTLOCKUP
@@ -102,7 +106,9 @@ static int __maybe_unused one = 1;
 static int __maybe_unused two = 2;
 static unsigned long one_ul = 1;
 static int one_hundred = 100;
-static int one_thousand = 1000;
+
+/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
+static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
 
 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
 static int maxolduid = 65535;
@@ -113,6 +119,7 @@ static int ngroups_max = NGROUPS_MAX;
 
 #ifdef CONFIG_MODULES
 extern char modprobe_path[];
+extern int modules_disabled;
 #endif
 #ifdef CONFIG_CHR_DEV_SG
 extern int sg_big_buff;
@@ -241,6 +248,14 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC;       /* 1 second */
 #endif
 
 static struct ctl_table kern_table[] = {
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "sched_child_runs_first",
+               .data           = &sysctl_sched_child_runs_first,
+               .maxlen         = sizeof(unsigned int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
 #ifdef CONFIG_SCHED_DEBUG
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -295,14 +310,6 @@ static struct ctl_table kern_table[] = {
        },
        {
                .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "sched_child_runs_first",
-               .data           = &sysctl_sched_child_runs_first,
-               .maxlen         = sizeof(unsigned int),
-               .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-       },
-       {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_features",
                .data           = &sysctl_sched_features,
                .maxlen         = sizeof(unsigned int),
@@ -325,6 +332,25 @@ static struct ctl_table kern_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "sched_time_avg",
+               .data           = &sysctl_sched_time_avg,
+               .maxlen         = sizeof(unsigned int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "timer_migration",
+               .data           = &sysctl_timer_migration,
+               .maxlen         = sizeof(unsigned int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec_minmax,
+               .strategy       = &sysctl_intvec,
+               .extra1         = &zero,
+               .extra2         = &one,
+       },
 #endif
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -533,6 +559,17 @@ static struct ctl_table kern_table[] = {
                .proc_handler   = &proc_dostring,
                .strategy       = &sysctl_string,
        },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "modules_disabled",
+               .data           = &modules_disabled,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               /* only handle a transition from default "0" to "1" */
+               .proc_handler   = &proc_dointvec_minmax,
+               .extra1         = &one,
+               .extra2         = &one,
+       },
 #endif
 #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
        {
@@ -721,6 +758,14 @@ static struct ctl_table kern_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "panic_on_io_nmi",
+               .data           = &panic_on_io_nmi,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+       {
                .ctl_name       = KERN_BOOTLOADER_TYPE,
                .procname       = "bootloader_type",
                .data           = &bootloader_type,
@@ -730,6 +775,14 @@ static struct ctl_table kern_table[] = {
        },
        {
                .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "bootloader_version",
+               .data           = &bootloader_version,
+               .maxlen         = sizeof (int),
+               .mode           = 0444,
+               .proc_handler   = &proc_dointvec,
+       },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "kstack_depth_to_print",
                .data           = &kstack_depth_to_print,
                .maxlen         = sizeof(int),
@@ -903,16 +956,6 @@ static struct ctl_table kern_table[] = {
                .proc_handler   = &proc_dointvec,
        },
 #endif
-#ifdef CONFIG_UNEVICTABLE_LRU
-       {
-               .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "scan_unevictable_pages",
-               .data           = &scan_unevictable_pages,
-               .maxlen         = sizeof(scan_unevictable_pages),
-               .mode           = 0644,
-               .proc_handler   = &scan_unevictable_handler,
-       },
-#endif
 #ifdef CONFIG_SLOW_WORK
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -924,9 +967,45 @@ static struct ctl_table kern_table[] = {
 #ifdef CONFIG_PERF_COUNTERS
        {
                .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "perf_counter_privileged",
-               .data           = &sysctl_perf_counter_priv,
-               .maxlen         = sizeof(sysctl_perf_counter_priv),
+               .procname       = "perf_counter_paranoid",
+               .data           = &sysctl_perf_counter_paranoid,
+               .maxlen         = sizeof(sysctl_perf_counter_paranoid),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "perf_counter_mlock_kb",
+               .data           = &sysctl_perf_counter_mlock,
+               .maxlen         = sizeof(sysctl_perf_counter_mlock),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "perf_counter_max_sample_rate",
+               .data           = &sysctl_perf_counter_sample_rate,
+               .maxlen         = sizeof(sysctl_perf_counter_sample_rate),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+#endif
+#ifdef CONFIG_KMEMCHECK
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "kmemcheck",
+               .data           = &kmemcheck_enabled,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+#endif
+#ifdef CONFIG_BLOCK
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "blk_iopoll",
+               .data           = &blk_iopoll_enabled,
+               .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
@@ -1027,7 +1106,7 @@ static struct ctl_table vm_table[] = {
                .mode           = 0644,
                .proc_handler   = &dirty_bytes_handler,
                .strategy       = &sysctl_intvec,
-               .extra1         = &one_ul,
+               .extra1         = &dirty_bytes_min,
        },
        {
                .procname       = "dirty_writeback_centisecs",
@@ -1052,28 +1131,6 @@ static struct ctl_table vm_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "nr_pdflush_threads_min",
-               .data           = &nr_pdflush_threads_min,
-               .maxlen         = sizeof nr_pdflush_threads_min,
-               .mode           = 0644 /* read-write */,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
-               .extra1         = &one,
-               .extra2         = &nr_pdflush_threads_max,
-       },
-       {
-               .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "nr_pdflush_threads_max",
-               .data           = &nr_pdflush_threads_max,
-               .maxlen         = sizeof nr_pdflush_threads_max,
-               .mode           = 0644 /* read-write */,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
-               .extra1         = &nr_pdflush_threads_min,
-               .extra2         = &one_thousand,
-       },
-       {
                .ctl_name       = VM_SWAPPINESS,
                .procname       = "swappiness",
                .data           = &vm_swappiness,
@@ -1266,16 +1323,14 @@ static struct ctl_table vm_table[] = {
                .strategy       = &sysctl_jiffies,
        },
 #endif
-#ifdef CONFIG_SECURITY
        {
                .ctl_name       = CTL_UNNUMBERED,
                .procname       = "mmap_min_addr",
-               .data           = &mmap_min_addr,
-               .maxlen         = sizeof(unsigned long),
+               .data           = &dac_mmap_min_addr,
+               .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = &mmap_min_addr_handler,
        },
-#endif
 #ifdef CONFIG_NUMA
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -1313,6 +1368,14 @@ static struct ctl_table vm_table[] = {
                .extra2         = &one,
        },
 #endif
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "scan_unevictable_pages",
+               .data           = &scan_unevictable_pages,
+               .maxlen         = sizeof(scan_unevictable_pages),
+               .mode           = 0644,
+               .proc_handler   = &scan_unevictable_handler,
+       },
 /*
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
@@ -2251,7 +2314,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
                  void *data)
 {
 #define TMPBUFLEN 21
-       int *i, vleft, first=1, neg, val;
+       int *i, vleft, first = 1, neg;
        unsigned long lval;
        size_t left, len;
        
@@ -2304,8 +2367,6 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
                        len = p-buf;
                        if ((len < left) && *p && !isspace(*p))
                                break;
-                       if (neg)
-                               val = -val;
                        s += len;
                        left -= len;