aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2010-05-24 17:32:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:06:59 -0400
commit76ab0f530e4a01d4dc20cdc1d5e87753c579dc18 (patch)
tree8e1566df85e02f67876685c36d217fec4845f79f /kernel
parent748446bb6b5a9390b546af38ec899c868a9dbcf0 (diff)
mm: compaction: add /proc trigger for memory compaction
Add a proc file /proc/sys/vm/compact_memory. When an arbitrary value is written to the file, all zones are compacted. The expected user of such a trigger is a job scheduler that prepares the system before the target application runs. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Rik van Riel <riel@redhat.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sysctl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 4c93486b45d1..284f330d6a01 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>
@@ -1121,6 +1122,15 @@ static struct ctl_table vm_table[] = {
1121 .mode = 0644, 1122 .mode = 0644,
1122 .proc_handler = drop_caches_sysctl_handler, 1123 .proc_handler = drop_caches_sysctl_handler,
1123 }, 1124 },
1125#ifdef CONFIG_COMPACTION
1126 {
1127 .procname = "compact_memory",
1128 .data = &sysctl_compact_memory,
1129 .maxlen = sizeof(int),
1130 .mode = 0200,
1131 .proc_handler = sysctl_compaction_handler,
1132 },
1133#endif /* CONFIG_COMPACTION */
1124 { 1134 {
1125 .procname = "min_free_kbytes", 1135 .procname = "min_free_kbytes",
1126 .data = &min_free_kbytes, 1136 .data = &min_free_kbytes,