aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c78
1 files changed, 60 insertions, 18 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index c5ef44ff850f..e3d2c7dd59b9 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,12 @@ 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;
106 105
107/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ 106/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
108static int maxolduid = 65535; 107static int maxolduid = 65535;
@@ -815,6 +814,19 @@ static struct ctl_table kern_table[] = {
815 .extra1 = &neg_one, 814 .extra1 = &neg_one,
816 .extra2 = &sixty, 815 .extra2 = &sixty,
817 }, 816 },
817#endif
818#ifdef CONFIG_DETECT_HUNG_TASK
819 {
820 .ctl_name = CTL_UNNUMBERED,
821 .procname = "hung_task_panic",
822 .data = &sysctl_hung_task_panic,
823 .maxlen = sizeof(int),
824 .mode = 0644,
825 .proc_handler = &proc_dointvec_minmax,
826 .strategy = &sysctl_intvec,
827 .extra1 = &zero,
828 .extra2 = &one,
829 },
818 { 830 {
819 .ctl_name = CTL_UNNUMBERED, 831 .ctl_name = CTL_UNNUMBERED,
820 .procname = "hung_task_check_count", 832 .procname = "hung_task_check_count",
@@ -830,7 +842,7 @@ static struct ctl_table kern_table[] = {
830 .data = &sysctl_hung_task_timeout_secs, 842 .data = &sysctl_hung_task_timeout_secs,
831 .maxlen = sizeof(unsigned long), 843 .maxlen = sizeof(unsigned long),
832 .mode = 0644, 844 .mode = 0644,
833 .proc_handler = &proc_doulongvec_minmax, 845 .proc_handler = &proc_dohung_task_timeout_secs,
834 .strategy = &sysctl_intvec, 846 .strategy = &sysctl_intvec,
835 }, 847 },
836 { 848 {
@@ -890,14 +902,12 @@ static struct ctl_table kern_table[] = {
890 .proc_handler = &proc_dointvec, 902 .proc_handler = &proc_dointvec,
891 }, 903 },
892#endif 904#endif
893#ifdef CONFIG_UNEVICTABLE_LRU 905#ifdef CONFIG_SLOW_WORK
894 { 906 {
895 .ctl_name = CTL_UNNUMBERED, 907 .ctl_name = CTL_UNNUMBERED,
896 .procname = "scan_unevictable_pages", 908 .procname = "slow-work",
897 .data = &scan_unevictable_pages, 909 .mode = 0555,
898 .maxlen = sizeof(scan_unevictable_pages), 910 .child = slow_work_sysctls,
899 .mode = 0644,
900 .proc_handler = &scan_unevictable_handler,
901 }, 911 },
902#endif 912#endif
903/* 913/*
@@ -1010,7 +1020,7 @@ static struct ctl_table vm_table[] = {
1010 .data = &dirty_expire_interval, 1020 .data = &dirty_expire_interval,
1011 .maxlen = sizeof(dirty_expire_interval), 1021 .maxlen = sizeof(dirty_expire_interval),
1012 .mode = 0644, 1022 .mode = 0644,
1013 .proc_handler = &proc_dointvec_userhz_jiffies, 1023 .proc_handler = &proc_dointvec,
1014 }, 1024 },
1015 { 1025 {
1016 .ctl_name = VM_NR_PDFLUSH_THREADS, 1026 .ctl_name = VM_NR_PDFLUSH_THREADS,
@@ -1021,6 +1031,28 @@ static struct ctl_table vm_table[] = {
1021 .proc_handler = &proc_dointvec, 1031 .proc_handler = &proc_dointvec,
1022 }, 1032 },
1023 { 1033 {
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 {
1024 .ctl_name = VM_SWAPPINESS, 1056 .ctl_name = VM_SWAPPINESS,
1025 .procname = "swappiness", 1057 .procname = "swappiness",
1026 .data = &vm_swappiness, 1058 .data = &vm_swappiness,
@@ -1260,6 +1292,16 @@ static struct ctl_table vm_table[] = {
1260 .extra2 = &one, 1292 .extra2 = &one,
1261 }, 1293 },
1262#endif 1294#endif
1295#ifdef CONFIG_UNEVICTABLE_LRU
1296 {
1297 .ctl_name = CTL_UNNUMBERED,
1298 .procname = "scan_unevictable_pages",
1299 .data = &scan_unevictable_pages,
1300 .maxlen = sizeof(scan_unevictable_pages),
1301 .mode = 0644,
1302 .proc_handler = &scan_unevictable_handler,
1303 },
1304#endif
1263/* 1305/*
1264 * NOTE: do not add new entries to this table unless you have read 1306 * NOTE: do not add new entries to this table unless you have read
1265 * Documentation/sysctl/ctl_unnumbered.txt 1307 * Documentation/sysctl/ctl_unnumbered.txt
@@ -1373,10 +1415,7 @@ static struct ctl_table fs_table[] = {
1373 .data = &lease_break_time, 1415 .data = &lease_break_time,
1374 .maxlen = sizeof(int), 1416 .maxlen = sizeof(int),
1375 .mode = 0644, 1417 .mode = 0644,
1376 .proc_handler = &proc_dointvec_minmax, 1418 .proc_handler = &proc_dointvec,
1377 .strategy = &sysctl_intvec,
1378 .extra1 = &zero,
1379 .extra2 = &two,
1380 }, 1419 },
1381#endif 1420#endif
1382#ifdef CONFIG_AIO 1421#ifdef CONFIG_AIO
@@ -1417,7 +1456,10 @@ static struct ctl_table fs_table[] = {
1417 .data = &suid_dumpable, 1456 .data = &suid_dumpable,
1418 .maxlen = sizeof(int), 1457 .maxlen = sizeof(int),
1419 .mode = 0644, 1458 .mode = 0644,
1420 .proc_handler = &proc_dointvec, 1459 .proc_handler = &proc_dointvec_minmax,
1460 .strategy = &sysctl_intvec,
1461 .extra1 = &zero,
1462 .extra2 = &two,
1421 }, 1463 },
1422#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) 1464#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1423 { 1465 {