summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichal Nazarewicz <mina86@mina86.com>2011-12-29 13:09:50 +0100
committerMarek Szyprowski <m.szyprowski@samsung.com>2012-05-21 15:09:31 +0200
commit041d3a8cdc18dc375a128d90bbb753949a81b1fb (patch)
tree26f5e1b30f638ea148e7deb13c44d0d0f1d39935 /include
parentff9543fd32060917beb080b1eb2d1d41ec7f39e0 (diff)
mm: page_alloc: introduce alloc_contig_range()
This commit adds the alloc_contig_range() function which tries to allocate given range of pages. It tries to migrate all already allocated pages that fall in the range thus freeing them. Once all pages in the range are freed they are removed from the buddy system thus allocated for the caller to use. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Tested-by: Rob Clark <rob.clark@linaro.org> Tested-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Tested-by: Robert Nelson <robertcnelson@gmail.com> Tested-by: Barry Song <Baohua.Song@csr.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/gfp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 581e74b7df95..052a5b6cc4d0 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -391,4 +391,12 @@ static inline bool pm_suspended_storage(void)
}
#endif /* CONFIG_PM_SLEEP */
+#ifdef CONFIG_CMA
+
+/* The below functions must be run on a range from a single zone. */
+extern int alloc_contig_range(unsigned long start, unsigned long end);
+extern void free_contig_range(unsigned long pfn, unsigned nr_pages);
+
+#endif
+
#endif /* __LINUX_GFP_H */