aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2009-05-08 03:56:47 -0400
committerJames Morris <jmorris@namei.org>2009-05-08 03:56:47 -0400
commitd254117099d711f215e62427f55dfb8ebd5ad011 (patch)
tree0848ff8dd74314fec14a86497f8d288c86ba7c65 /kernel/sysctl.c
parent07ff7a0b187f3951788f64ae1f30e8109bc8e9eb (diff)
parent8c9ed899b44c19e81859fbb0e9d659fe2f8630fc (diff)
Merge branch 'master' into next
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c83
1 files changed, 64 insertions, 19 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 2fb4246d27de..98ecf35d5bf2 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -48,6 +48,7 @@
48#include <linux/acpi.h> 48#include <linux/acpi.h>
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 52
52#include <asm/uaccess.h> 53#include <asm/uaccess.h>
53#include <asm/processor.h> 54#include <asm/processor.h>
@@ -95,14 +96,15 @@ static int sixty = 60;
95static int neg_one = -1; 96static int neg_one = -1;
96#endif 97#endif
97 98
98#if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING)
99static int two = 2;
100#endif
101
102static int zero; 99static int zero;
103static int one = 1; 100static int __maybe_unused one = 1;
101static int __maybe_unused two = 2;
104static unsigned long one_ul = 1; 102static unsigned long one_ul = 1;
105static int one_hundred = 100; 103static 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;
106 108
107/* 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 */
108static int maxolduid = 65535; 110static int maxolduid = 65535;
@@ -827,6 +829,19 @@ static struct ctl_table kern_table[] = {
827 .extra1 = &neg_one, 829 .extra1 = &neg_one,
828 .extra2 = &sixty, 830 .extra2 = &sixty,
829 }, 831 },
832#endif
833#ifdef CONFIG_DETECT_HUNG_TASK
834 {
835 .ctl_name = CTL_UNNUMBERED,
836 .procname = "hung_task_panic",
837 .data = &sysctl_hung_task_panic,
838 .maxlen = sizeof(int),
839 .mode = 0644,
840 .proc_handler = &proc_dointvec_minmax,
841 .strategy = &sysctl_intvec,
842 .extra1 = &zero,
843 .extra2 = &one,
844 },
830 { 845 {
831 .ctl_name = CTL_UNNUMBERED, 846 .ctl_name = CTL_UNNUMBERED,
832 .procname = "hung_task_check_count", 847 .procname = "hung_task_check_count",
@@ -842,7 +857,7 @@ static struct ctl_table kern_table[] = {
842 .data = &sysctl_hung_task_timeout_secs, 857 .data = &sysctl_hung_task_timeout_secs,
843 .maxlen = sizeof(unsigned long), 858 .maxlen = sizeof(unsigned long),
844 .mode = 0644, 859 .mode = 0644,
845 .proc_handler = &proc_doulongvec_minmax, 860 .proc_handler = &proc_dohung_task_timeout_secs,
846 .strategy = &sysctl_intvec, 861 .strategy = &sysctl_intvec,
847 }, 862 },
848 { 863 {
@@ -902,14 +917,12 @@ static struct ctl_table kern_table[] = {
902 .proc_handler = &proc_dointvec, 917 .proc_handler = &proc_dointvec,
903 }, 918 },
904#endif 919#endif
905#ifdef CONFIG_UNEVICTABLE_LRU 920#ifdef CONFIG_SLOW_WORK
906 { 921 {
907 .ctl_name = CTL_UNNUMBERED, 922 .ctl_name = CTL_UNNUMBERED,
908 .procname = "scan_unevictable_pages", 923 .procname = "slow-work",
909 .data = &scan_unevictable_pages, 924 .mode = 0555,
910 .maxlen = sizeof(scan_unevictable_pages), 925 .child = slow_work_sysctls,
911 .mode = 0644,
912 .proc_handler = &scan_unevictable_handler,
913 }, 926 },
914#endif 927#endif
915/* 928/*
@@ -1008,7 +1021,7 @@ static struct ctl_table vm_table[] = {
1008 .mode = 0644, 1021 .mode = 0644,
1009 .proc_handler = &dirty_bytes_handler, 1022 .proc_handler = &dirty_bytes_handler,
1010 .strategy = &sysctl_intvec, 1023 .strategy = &sysctl_intvec,
1011 .extra1 = &one_ul, 1024 .extra1 = &dirty_bytes_min,
1012 }, 1025 },
1013 { 1026 {
1014 .procname = "dirty_writeback_centisecs", 1027 .procname = "dirty_writeback_centisecs",
@@ -1022,7 +1035,7 @@ static struct ctl_table vm_table[] = {
1022 .data = &dirty_expire_interval, 1035 .data = &dirty_expire_interval,
1023 .maxlen = sizeof(dirty_expire_interval), 1036 .maxlen = sizeof(dirty_expire_interval),
1024 .mode = 0644, 1037 .mode = 0644,
1025 .proc_handler = &proc_dointvec_userhz_jiffies, 1038 .proc_handler = &proc_dointvec,
1026 }, 1039 },
1027 { 1040 {
1028 .ctl_name = VM_NR_PDFLUSH_THREADS, 1041 .ctl_name = VM_NR_PDFLUSH_THREADS,
@@ -1033,6 +1046,28 @@ static struct ctl_table vm_table[] = {
1033 .proc_handler = &proc_dointvec, 1046 .proc_handler = &proc_dointvec,
1034 }, 1047 },
1035 { 1048 {
1049 .ctl_name = CTL_UNNUMBERED,
1050 .procname = "nr_pdflush_threads_min",
1051 .data = &nr_pdflush_threads_min,
1052 .maxlen = sizeof nr_pdflush_threads_min,
1053 .mode = 0644 /* read-write */,
1054 .proc_handler = &proc_dointvec_minmax,
1055 .strategy = &sysctl_intvec,
1056 .extra1 = &one,
1057 .extra2 = &nr_pdflush_threads_max,
1058 },
1059 {
1060 .ctl_name = CTL_UNNUMBERED,
1061 .procname = "nr_pdflush_threads_max",
1062 .data = &nr_pdflush_threads_max,
1063 .maxlen = sizeof nr_pdflush_threads_max,
1064 .mode = 0644 /* read-write */,
1065 .proc_handler = &proc_dointvec_minmax,
1066 .strategy = &sysctl_intvec,
1067 .extra1 = &nr_pdflush_threads_min,
1068 .extra2 = &one_thousand,
1069 },
1070 {
1036 .ctl_name = VM_SWAPPINESS, 1071 .ctl_name = VM_SWAPPINESS,
1037 .procname = "swappiness", 1072 .procname = "swappiness",
1038 .data = &vm_swappiness, 1073 .data = &vm_swappiness,
@@ -1272,6 +1307,16 @@ static struct ctl_table vm_table[] = {
1272 .extra2 = &one, 1307 .extra2 = &one,
1273 }, 1308 },
1274#endif 1309#endif
1310#ifdef CONFIG_UNEVICTABLE_LRU
1311 {
1312 .ctl_name = CTL_UNNUMBERED,
1313 .procname = "scan_unevictable_pages",
1314 .data = &scan_unevictable_pages,
1315 .maxlen = sizeof(scan_unevictable_pages),
1316 .mode = 0644,
1317 .proc_handler = &scan_unevictable_handler,
1318 },
1319#endif
1275/* 1320/*
1276 * NOTE: do not add new entries to this table unless you have read 1321 * NOTE: do not add new entries to this table unless you have read
1277 * Documentation/sysctl/ctl_unnumbered.txt 1322 * Documentation/sysctl/ctl_unnumbered.txt
@@ -1385,10 +1430,7 @@ static struct ctl_table fs_table[] = {
1385 .data = &lease_break_time, 1430 .data = &lease_break_time,
1386 .maxlen = sizeof(int), 1431 .maxlen = sizeof(int),
1387 .mode = 0644, 1432 .mode = 0644,
1388 .proc_handler = &proc_dointvec_minmax, 1433 .proc_handler = &proc_dointvec,
1389 .strategy = &sysctl_intvec,
1390 .extra1 = &zero,
1391 .extra2 = &two,
1392 }, 1434 },
1393#endif 1435#endif
1394#ifdef CONFIG_AIO 1436#ifdef CONFIG_AIO
@@ -1429,7 +1471,10 @@ static struct ctl_table fs_table[] = {
1429 .data = &suid_dumpable, 1471 .data = &suid_dumpable,
1430 .maxlen = sizeof(int), 1472 .maxlen = sizeof(int),
1431 .mode = 0644, 1473 .mode = 0644,
1432 .proc_handler = &proc_dointvec, 1474 .proc_handler = &proc_dointvec_minmax,
1475 .strategy = &sysctl_intvec,
1476 .extra1 = &zero,
1477 .extra2 = &two,
1433 }, 1478 },
1434#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) 1479#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1435 { 1480 {