aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c71
1 files changed, 57 insertions, 14 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 790f9d785663..4286b62b34a0 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,13 +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;
102static unsigned long one_ul = 1;
104static int one_hundred = 100; 103static int one_hundred = 100;
104static int one_thousand = 1000;
105 105
106/* 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 */
107static int maxolduid = 65535; 107static int maxolduid = 65535;
@@ -814,6 +814,19 @@ static struct ctl_table kern_table[] = {
814 .extra1 = &neg_one, 814 .extra1 = &neg_one,
815 .extra2 = &sixty, 815 .extra2 = &sixty,
816 }, 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 },
817 { 830 {
818 .ctl_name = CTL_UNNUMBERED, 831 .ctl_name = CTL_UNNUMBERED,
819 .procname = "hung_task_check_count", 832 .procname = "hung_task_check_count",
@@ -829,7 +842,7 @@ static struct ctl_table kern_table[] = {
829 .data = &sysctl_hung_task_timeout_secs, 842 .data = &sysctl_hung_task_timeout_secs,
830 .maxlen = sizeof(unsigned long), 843 .maxlen = sizeof(unsigned long),
831 .mode = 0644, 844 .mode = 0644,
832 .proc_handler = &proc_doulongvec_minmax, 845 .proc_handler = &proc_dohung_task_timeout_secs,
833 .strategy = &sysctl_intvec, 846 .strategy = &sysctl_intvec,
834 }, 847 },
835 { 848 {
@@ -899,6 +912,14 @@ static struct ctl_table kern_table[] = {
899 .proc_handler = &scan_unevictable_handler, 912 .proc_handler = &scan_unevictable_handler,
900 }, 913 },
901#endif 914#endif
915#ifdef CONFIG_SLOW_WORK
916 {
917 .ctl_name = CTL_UNNUMBERED,
918 .procname = "slow-work",
919 .mode = 0555,
920 .child = slow_work_sysctls,
921 },
922#endif
902/* 923/*
903 * NOTE: do not add new entries to this table unless you have read 924 * NOTE: do not add new entries to this table unless you have read
904 * Documentation/sysctl/ctl_unnumbered.txt 925 * Documentation/sysctl/ctl_unnumbered.txt
@@ -974,7 +995,7 @@ static struct ctl_table vm_table[] = {
974 .mode = 0644, 995 .mode = 0644,
975 .proc_handler = &dirty_background_bytes_handler, 996 .proc_handler = &dirty_background_bytes_handler,
976 .strategy = &sysctl_intvec, 997 .strategy = &sysctl_intvec,
977 .extra1 = &one, 998 .extra1 = &one_ul,
978 }, 999 },
979 { 1000 {
980 .ctl_name = VM_DIRTY_RATIO, 1001 .ctl_name = VM_DIRTY_RATIO,
@@ -995,7 +1016,7 @@ static struct ctl_table vm_table[] = {
995 .mode = 0644, 1016 .mode = 0644,
996 .proc_handler = &dirty_bytes_handler, 1017 .proc_handler = &dirty_bytes_handler,
997 .strategy = &sysctl_intvec, 1018 .strategy = &sysctl_intvec,
998 .extra1 = &one, 1019 .extra1 = &one_ul,
999 }, 1020 },
1000 { 1021 {
1001 .procname = "dirty_writeback_centisecs", 1022 .procname = "dirty_writeback_centisecs",
@@ -1009,7 +1030,7 @@ static struct ctl_table vm_table[] = {
1009 .data = &dirty_expire_interval, 1030 .data = &dirty_expire_interval,
1010 .maxlen = sizeof(dirty_expire_interval), 1031 .maxlen = sizeof(dirty_expire_interval),
1011 .mode = 0644, 1032 .mode = 0644,
1012 .proc_handler = &proc_dointvec_userhz_jiffies, 1033 .proc_handler = &proc_dointvec,
1013 }, 1034 },
1014 { 1035 {
1015 .ctl_name = VM_NR_PDFLUSH_THREADS, 1036 .ctl_name = VM_NR_PDFLUSH_THREADS,
@@ -1020,6 +1041,28 @@ static struct ctl_table vm_table[] = {
1020 .proc_handler = &proc_dointvec, 1041 .proc_handler = &proc_dointvec,
1021 }, 1042 },
1022 { 1043 {
1044 .ctl_name = CTL_UNNUMBERED,
1045 .procname = "nr_pdflush_threads_min",
1046 .data = &nr_pdflush_threads_min,
1047 .maxlen = sizeof nr_pdflush_threads_min,
1048 .mode = 0644 /* read-write */,
1049 .proc_handler = &proc_dointvec_minmax,
1050 .strategy = &sysctl_intvec,
1051 .extra1 = &one,
1052 .extra2 = &nr_pdflush_threads_max,
1053 },
1054 {
1055 .ctl_name = CTL_UNNUMBERED,
1056 .procname = "nr_pdflush_threads_max",
1057 .data = &nr_pdflush_threads_max,
1058 .maxlen = sizeof nr_pdflush_threads_max,
1059 .mode = 0644 /* read-write */,
1060 .proc_handler = &proc_dointvec_minmax,
1061 .strategy = &sysctl_intvec,
1062 .extra1 = &nr_pdflush_threads_min,
1063 .extra2 = &one_thousand,
1064 },
1065 {
1023 .ctl_name = VM_SWAPPINESS, 1066 .ctl_name = VM_SWAPPINESS,
1024 .procname = "swappiness", 1067 .procname = "swappiness",
1025 .data = &vm_swappiness, 1068 .data = &vm_swappiness,
@@ -1372,10 +1415,7 @@ static struct ctl_table fs_table[] = {
1372 .data = &lease_break_time, 1415 .data = &lease_break_time,
1373 .maxlen = sizeof(int), 1416 .maxlen = sizeof(int),
1374 .mode = 0644, 1417 .mode = 0644,
1375 .proc_handler = &proc_dointvec_minmax, 1418 .proc_handler = &proc_dointvec,
1376 .strategy = &sysctl_intvec,
1377 .extra1 = &zero,
1378 .extra2 = &two,
1379 }, 1419 },
1380#endif 1420#endif
1381#ifdef CONFIG_AIO 1421#ifdef CONFIG_AIO
@@ -1416,7 +1456,10 @@ static struct ctl_table fs_table[] = {
1416 .data = &suid_dumpable, 1456 .data = &suid_dumpable,
1417 .maxlen = sizeof(int), 1457 .maxlen = sizeof(int),
1418 .mode = 0644, 1458 .mode = 0644,
1419 .proc_handler = &proc_dointvec, 1459 .proc_handler = &proc_dointvec_minmax,
1460 .strategy = &sysctl_intvec,
1461 .extra1 = &zero,
1462 .extra2 = &two,
1420 }, 1463 },
1421#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) 1464#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1422 { 1465 {