aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c72
1 files changed, 53 insertions, 19 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index f948f20f09cb..997080f00e0b 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -37,6 +37,7 @@
37#include <linux/highuid.h> 37#include <linux/highuid.h>
38#include <linux/writeback.h> 38#include <linux/writeback.h>
39#include <linux/ratelimit.h> 39#include <linux/ratelimit.h>
40#include <linux/compaction.h>
40#include <linux/hugetlb.h> 41#include <linux/hugetlb.h>
41#include <linux/initrd.h> 42#include <linux/initrd.h>
42#include <linux/key.h> 43#include <linux/key.h>
@@ -52,6 +53,7 @@
52#include <linux/slow-work.h> 53#include <linux/slow-work.h>
53#include <linux/perf_event.h> 54#include <linux/perf_event.h>
54#include <linux/kprobes.h> 55#include <linux/kprobes.h>
56#include <linux/pipe_fs_i.h>
55 57
56#include <asm/uaccess.h> 58#include <asm/uaccess.h>
57#include <asm/processor.h> 59#include <asm/processor.h>
@@ -261,6 +263,11 @@ static int min_sched_shares_ratelimit = 100000; /* 100 usec */
261static int max_sched_shares_ratelimit = NSEC_PER_SEC; /* 1 second */ 263static int max_sched_shares_ratelimit = NSEC_PER_SEC; /* 1 second */
262#endif 264#endif
263 265
266#ifdef CONFIG_COMPACTION
267static int min_extfrag_threshold;
268static int max_extfrag_threshold = 1000;
269#endif
270
264static struct ctl_table kern_table[] = { 271static struct ctl_table kern_table[] = {
265 { 272 {
266 .procname = "sched_child_runs_first", 273 .procname = "sched_child_runs_first",
@@ -1120,6 +1127,25 @@ static struct ctl_table vm_table[] = {
1120 .mode = 0644, 1127 .mode = 0644,
1121 .proc_handler = drop_caches_sysctl_handler, 1128 .proc_handler = drop_caches_sysctl_handler,
1122 }, 1129 },
1130#ifdef CONFIG_COMPACTION
1131 {
1132 .procname = "compact_memory",
1133 .data = &sysctl_compact_memory,
1134 .maxlen = sizeof(int),
1135 .mode = 0200,
1136 .proc_handler = sysctl_compaction_handler,
1137 },
1138 {
1139 .procname = "extfrag_threshold",
1140 .data = &sysctl_extfrag_threshold,
1141 .maxlen = sizeof(int),
1142 .mode = 0644,
1143 .proc_handler = sysctl_extfrag_handler,
1144 .extra1 = &min_extfrag_threshold,
1145 .extra2 = &max_extfrag_threshold,
1146 },
1147
1148#endif /* CONFIG_COMPACTION */
1123 { 1149 {
1124 .procname = "min_free_kbytes", 1150 .procname = "min_free_kbytes",
1125 .data = &min_free_kbytes, 1151 .data = &min_free_kbytes,
@@ -1444,6 +1470,14 @@ static struct ctl_table fs_table[] = {
1444 .child = binfmt_misc_table, 1470 .child = binfmt_misc_table,
1445 }, 1471 },
1446#endif 1472#endif
1473 {
1474 .procname = "pipe-max-pages",
1475 .data = &pipe_max_pages,
1476 .maxlen = sizeof(int),
1477 .mode = 0644,
1478 .proc_handler = &proc_dointvec_minmax,
1479 .extra1 = &two,
1480 },
1447/* 1481/*
1448 * NOTE: do not add new entries to this table unless you have read 1482 * NOTE: do not add new entries to this table unless you have read
1449 * Documentation/sysctl/ctl_unnumbered.txt 1483 * Documentation/sysctl/ctl_unnumbered.txt
@@ -2083,20 +2117,20 @@ static void proc_skip_char(char **buf, size_t *size, const char v)
2083 2117
2084#define TMPBUFLEN 22 2118#define TMPBUFLEN 22
2085/** 2119/**
2086 * proc_get_long - reads an ASCII formated integer from a user buffer 2120 * proc_get_long - reads an ASCII formatted integer from a user buffer
2087 * 2121 *
2088 * @buf - a kernel buffer 2122 * @buf: a kernel buffer
2089 * @size - size of the kernel buffer 2123 * @size: size of the kernel buffer
2090 * @val - this is where the number will be stored 2124 * @val: this is where the number will be stored
2091 * @neg - set to %TRUE if number is negative 2125 * @neg: set to %TRUE if number is negative
2092 * @perm_tr - a vector which contains the allowed trailers 2126 * @perm_tr: a vector which contains the allowed trailers
2093 * @perm_tr_len - size of the perm_tr vector 2127 * @perm_tr_len: size of the perm_tr vector
2094 * @tr - pointer to store the trailer character 2128 * @tr: pointer to store the trailer character
2095 * 2129 *
2096 * In case of success 0 is returned and buf and size are updated with 2130 * In case of success %0 is returned and @buf and @size are updated with
2097 * the amount of bytes read. If tr is non NULL and a trailing 2131 * the amount of bytes read. If @tr is non-NULL and a trailing
2098 * character exist (size is non zero after returning from this 2132 * character exists (size is non-zero after returning from this
2099 * function) tr is updated with the trailing character. 2133 * function), @tr is updated with the trailing character.
2100 */ 2134 */
2101static int proc_get_long(char **buf, size_t *size, 2135static int proc_get_long(char **buf, size_t *size,
2102 unsigned long *val, bool *neg, 2136 unsigned long *val, bool *neg,
@@ -2147,15 +2181,15 @@ static int proc_get_long(char **buf, size_t *size,
2147} 2181}
2148 2182
2149/** 2183/**
2150 * proc_put_long - coverts an integer to a decimal ASCII formated string 2184 * proc_put_long - converts an integer to a decimal ASCII formatted string
2151 * 2185 *
2152 * @buf - the user buffer 2186 * @buf: the user buffer
2153 * @size - the size of the user buffer 2187 * @size: the size of the user buffer
2154 * @val - the integer to be converted 2188 * @val: the integer to be converted
2155 * @neg - sign of the number, %TRUE for negative 2189 * @neg: sign of the number, %TRUE for negative
2156 * 2190 *
2157 * In case of success 0 is returned and buf and size are updated with 2191 * In case of success %0 is returned and @buf and @size are updated with
2158 * the amount of bytes read. 2192 * the amount of bytes written.
2159 */ 2193 */
2160static int proc_put_long(void __user **buf, size_t *size, unsigned long val, 2194static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
2161 bool neg) 2195 bool neg)