diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2011-12-29 13:09:50 +0100 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-05-21 15:09:31 +0200 |
commit | 041d3a8cdc18dc375a128d90bbb753949a81b1fb (patch) | |
tree | 26f5e1b30f638ea148e7deb13c44d0d0f1d39935 /include/linux/gfp.h | |
parent | ff9543fd32060917beb080b1eb2d1d41ec7f39e0 (diff) | |
download | op-kernel-dev-041d3a8cdc18dc375a128d90bbb753949a81b1fb.zip op-kernel-dev-041d3a8cdc18dc375a128d90bbb753949a81b1fb.tar.gz |
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/linux/gfp.h')
-rw-r--r-- | include/linux/gfp.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 581e74b..052a5b6 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 */ |