diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 2e490a389dd2..b2970d56fb76 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,15 +96,15 @@ static int sixty = 60; | |||
95 | static int neg_one = -1; | 96 | static int neg_one = -1; |
96 | #endif | 97 | #endif |
97 | 98 | ||
98 | #if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING) | ||
99 | static int two = 2; | ||
100 | #endif | ||
101 | |||
102 | static int zero; | 99 | static int zero; |
103 | static int one = 1; | 100 | static int __maybe_unused one = 1; |
101 | static int __maybe_unused two = 2; | ||
104 | static unsigned long one_ul = 1; | 102 | static unsigned long one_ul = 1; |
105 | static int one_hundred = 100; | 103 | static int one_hundred = 100; |
106 | 104 | ||
105 | /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ | ||
106 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; | ||
107 | |||
107 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ | 108 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ |
108 | static int maxolduid = 65535; | 109 | static int maxolduid = 65535; |
109 | static int minolduid; | 110 | static int minolduid; |
@@ -815,6 +816,19 @@ static struct ctl_table kern_table[] = { | |||
815 | .extra1 = &neg_one, | 816 | .extra1 = &neg_one, |
816 | .extra2 = &sixty, | 817 | .extra2 = &sixty, |
817 | }, | 818 | }, |
819 | #endif | ||
820 | #ifdef CONFIG_DETECT_HUNG_TASK | ||
821 | { | ||
822 | .ctl_name = CTL_UNNUMBERED, | ||
823 | .procname = "hung_task_panic", | ||
824 | .data = &sysctl_hung_task_panic, | ||
825 | .maxlen = sizeof(int), | ||
826 | .mode = 0644, | ||
827 | .proc_handler = &proc_dointvec_minmax, | ||
828 | .strategy = &sysctl_intvec, | ||
829 | .extra1 = &zero, | ||
830 | .extra2 = &one, | ||
831 | }, | ||
818 | { | 832 | { |
819 | .ctl_name = CTL_UNNUMBERED, | 833 | .ctl_name = CTL_UNNUMBERED, |
820 | .procname = "hung_task_check_count", | 834 | .procname = "hung_task_check_count", |
@@ -830,7 +844,7 @@ static struct ctl_table kern_table[] = { | |||
830 | .data = &sysctl_hung_task_timeout_secs, | 844 | .data = &sysctl_hung_task_timeout_secs, |
831 | .maxlen = sizeof(unsigned long), | 845 | .maxlen = sizeof(unsigned long), |
832 | .mode = 0644, | 846 | .mode = 0644, |
833 | .proc_handler = &proc_doulongvec_minmax, | 847 | .proc_handler = &proc_dohung_task_timeout_secs, |
834 | .strategy = &sysctl_intvec, | 848 | .strategy = &sysctl_intvec, |
835 | }, | 849 | }, |
836 | { | 850 | { |
@@ -890,14 +904,12 @@ static struct ctl_table kern_table[] = { | |||
890 | .proc_handler = &proc_dointvec, | 904 | .proc_handler = &proc_dointvec, |
891 | }, | 905 | }, |
892 | #endif | 906 | #endif |
893 | #ifdef CONFIG_UNEVICTABLE_LRU | 907 | #ifdef CONFIG_SLOW_WORK |
894 | { | 908 | { |
895 | .ctl_name = CTL_UNNUMBERED, | 909 | .ctl_name = CTL_UNNUMBERED, |
896 | .procname = "scan_unevictable_pages", | 910 | .procname = "slow-work", |
897 | .data = &scan_unevictable_pages, | 911 | .mode = 0555, |
898 | .maxlen = sizeof(scan_unevictable_pages), | 912 | .child = slow_work_sysctls, |
899 | .mode = 0644, | ||
900 | .proc_handler = &scan_unevictable_handler, | ||
901 | }, | 913 | }, |
902 | #endif | 914 | #endif |
903 | /* | 915 | /* |
@@ -996,7 +1008,7 @@ static struct ctl_table vm_table[] = { | |||
996 | .mode = 0644, | 1008 | .mode = 0644, |
997 | .proc_handler = &dirty_bytes_handler, | 1009 | .proc_handler = &dirty_bytes_handler, |
998 | .strategy = &sysctl_intvec, | 1010 | .strategy = &sysctl_intvec, |
999 | .extra1 = &one_ul, | 1011 | .extra1 = &dirty_bytes_min, |
1000 | }, | 1012 | }, |
1001 | { | 1013 | { |
1002 | .procname = "dirty_writeback_centisecs", | 1014 | .procname = "dirty_writeback_centisecs", |
@@ -1260,6 +1272,16 @@ static struct ctl_table vm_table[] = { | |||
1260 | .extra2 = &one, | 1272 | .extra2 = &one, |
1261 | }, | 1273 | }, |
1262 | #endif | 1274 | #endif |
1275 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
1276 | { | ||
1277 | .ctl_name = CTL_UNNUMBERED, | ||
1278 | .procname = "scan_unevictable_pages", | ||
1279 | .data = &scan_unevictable_pages, | ||
1280 | .maxlen = sizeof(scan_unevictable_pages), | ||
1281 | .mode = 0644, | ||
1282 | .proc_handler = &scan_unevictable_handler, | ||
1283 | }, | ||
1284 | #endif | ||
1263 | /* | 1285 | /* |
1264 | * NOTE: do not add new entries to this table unless you have read | 1286 | * NOTE: do not add new entries to this table unless you have read |
1265 | * Documentation/sysctl/ctl_unnumbered.txt | 1287 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -1373,10 +1395,7 @@ static struct ctl_table fs_table[] = { | |||
1373 | .data = &lease_break_time, | 1395 | .data = &lease_break_time, |
1374 | .maxlen = sizeof(int), | 1396 | .maxlen = sizeof(int), |
1375 | .mode = 0644, | 1397 | .mode = 0644, |
1376 | .proc_handler = &proc_dointvec_minmax, | 1398 | .proc_handler = &proc_dointvec, |
1377 | .strategy = &sysctl_intvec, | ||
1378 | .extra1 = &zero, | ||
1379 | .extra2 = &two, | ||
1380 | }, | 1399 | }, |
1381 | #endif | 1400 | #endif |
1382 | #ifdef CONFIG_AIO | 1401 | #ifdef CONFIG_AIO |
@@ -1417,7 +1436,10 @@ static struct ctl_table fs_table[] = { | |||
1417 | .data = &suid_dumpable, | 1436 | .data = &suid_dumpable, |
1418 | .maxlen = sizeof(int), | 1437 | .maxlen = sizeof(int), |
1419 | .mode = 0644, | 1438 | .mode = 0644, |
1420 | .proc_handler = &proc_dointvec, | 1439 | .proc_handler = &proc_dointvec_minmax, |
1440 | .strategy = &sysctl_intvec, | ||
1441 | .extra1 = &zero, | ||
1442 | .extra2 = &two, | ||
1421 | }, | 1443 | }, |
1422 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | 1444 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
1423 | { | 1445 | { |