diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2012-04-03 09:06:15 -0400 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-05-21 09:09:33 -0400 |
commit | 0815f3d81d76dfbf2abcfd93a85ff0a6008fe4c0 (patch) | |
tree | 750e239c7c522a206bb04bd8bfcd89c3bf3be30d /include | |
parent | 47118af076f64844b4f423bc2f545b2da9dab50d (diff) |
mm: page_isolation: MIGRATE_CMA isolation functions added
This commit changes various functions that change pages and
pageblocks migrate type between MIGRATE_ISOLATE and
MIGRATE_MOVABLE in such a way as to allow to work with
MIGRATE_CMA migrate type.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
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.h | 3 | ||||
-rw-r--r-- | include/linux/page-isolation.h | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 78d32a7be257..1e49be49d324 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -394,7 +394,8 @@ static inline bool pm_suspended_storage(void) | |||
394 | #ifdef CONFIG_CMA | 394 | #ifdef CONFIG_CMA |
395 | 395 | ||
396 | /* The below functions must be run on a range from a single zone. */ | 396 | /* The below functions must be run on a range from a single zone. */ |
397 | extern int alloc_contig_range(unsigned long start, unsigned long end); | 397 | extern int alloc_contig_range(unsigned long start, unsigned long end, |
398 | unsigned migratetype); | ||
398 | extern void free_contig_range(unsigned long pfn, unsigned nr_pages); | 399 | extern void free_contig_range(unsigned long pfn, unsigned nr_pages); |
399 | 400 | ||
400 | /* CMA stuff */ | 401 | /* CMA stuff */ |
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index 051c1b1ede4e..3bdcab30ca41 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. | 5 | * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. |
6 | * If specified range includes migrate types other than MOVABLE, | 6 | * If specified range includes migrate types other than MOVABLE or CMA, |
7 | * this will fail with -EBUSY. | 7 | * this will fail with -EBUSY. |
8 | * | 8 | * |
9 | * For isolating all pages in the range finally, the caller have to | 9 | * For isolating all pages in the range finally, the caller have to |
@@ -11,27 +11,27 @@ | |||
11 | * test it. | 11 | * test it. |
12 | */ | 12 | */ |
13 | extern int | 13 | extern int |
14 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); | 14 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, |
15 | unsigned migratetype); | ||
15 | 16 | ||
16 | /* | 17 | /* |
17 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. | 18 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. |
18 | * target range is [start_pfn, end_pfn) | 19 | * target range is [start_pfn, end_pfn) |
19 | */ | 20 | */ |
20 | extern int | 21 | extern int |
21 | undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); | 22 | undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, |
23 | unsigned migratetype); | ||
22 | 24 | ||
23 | /* | 25 | /* |
24 | * test all pages in [start_pfn, end_pfn)are isolated or not. | 26 | * Test all pages in [start_pfn, end_pfn) are isolated or not. |
25 | */ | 27 | */ |
26 | extern int | 28 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); |
27 | test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Internal funcs.Changes pageblock's migrate type. | 31 | * Internal functions. Changes pageblock's migrate type. |
31 | * Please use make_pagetype_isolated()/make_pagetype_movable(). | ||
32 | */ | 32 | */ |
33 | extern int set_migratetype_isolate(struct page *page); | 33 | extern int set_migratetype_isolate(struct page *page); |
34 | extern void unset_migratetype_isolate(struct page *page); | 34 | extern void unset_migratetype_isolate(struct page *page, unsigned migratetype); |
35 | 35 | ||
36 | 36 | ||
37 | #endif | 37 | #endif |