aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2010-05-24 17:32:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:06:59 -0400
commited4a6d7f0676db50b5023cc01f6cda82a2f2a307 (patch)
tree6496343ba964e105cf30f8703714471f22edc806 /include/linux
parent76ab0f530e4a01d4dc20cdc1d5e87753c579dc18 (diff)
mm: compaction: add /sys trigger for per-node memory compaction
Add a per-node sysfs file called compact. When the file is written to, each zone in that node is compacted. The intention that this would be used by something like a job scheduler in a batch system before a job starts so that the job can allocate the maximum number of hugepages without significant start-up cost. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Rik van Riel <riel@redhat.com> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compaction.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 572388880ba8..ba98cfe0ae15 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -12,4 +12,20 @@ extern int sysctl_compaction_handler(struct ctl_table *table, int write,
12 void __user *buffer, size_t *length, loff_t *ppos); 12 void __user *buffer, size_t *length, loff_t *ppos);
13#endif /* CONFIG_COMPACTION */ 13#endif /* CONFIG_COMPACTION */
14 14
15#if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
16extern int compaction_register_node(struct node *node);
17extern void compaction_unregister_node(struct node *node);
18
19#else
20
21static inline int compaction_register_node(struct node *node)
22{
23 return 0;
24}
25
26static inline void compaction_unregister_node(struct node *node)
27{
28}
29#endif /* CONFIG_COMPACTION && CONFIG_SYSFS && CONFIG_NUMA */
30
15#endif /* _LINUX_COMPACTION_H */ 31#endif /* _LINUX_COMPACTION_H */