aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2012-07-31 19:43:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:45 -0400
commitee6f509c3274014d1f52e7a7a10aee9f85393c5e (patch)
treed8e5c816de0752b70b63f5de50ed52808ef3be9f /include/linux
parent876aafbfd9ba5bb352f1b14622c27f3fe9a99013 (diff)
mm: factor out memory isolate functions
mm/page_alloc.c has some memory isolation functions but they are used only when we enable CONFIG_{CMA|MEMORY_HOTPLUG|MEMORY_FAILURE}. So let's make it configurable by new CONFIG_MEMORY_ISOLATION so that it can reduce binary size and we can check it simple by CONFIG_MEMORY_ISOLATION, not if defined CONFIG_{CMA|MEMORY_HOTPLUG|MEMORY_FAILURE}. Signed-off-by: Minchan Kim <minchan@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Michal Hocko <mhocko@suse.cz> 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/page-isolation.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
index 3bdcab30ca4..105077aa768 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -1,6 +1,11 @@
1#ifndef __LINUX_PAGEISOLATION_H 1#ifndef __LINUX_PAGEISOLATION_H
2#define __LINUX_PAGEISOLATION_H 2#define __LINUX_PAGEISOLATION_H
3 3
4
5bool has_unmovable_pages(struct zone *zone, struct page *page, int count);
6void set_pageblock_migratetype(struct page *page, int migratetype);
7int move_freepages_block(struct zone *zone, struct page *page,
8 int migratetype);
4/* 9/*
5 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. 10 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE.
6 * If specified range includes migrate types other than MOVABLE or CMA, 11 * If specified range includes migrate types other than MOVABLE or CMA,
@@ -10,7 +15,7 @@
10 * free all pages in the range. test_page_isolated() can be used for 15 * free all pages in the range. test_page_isolated() can be used for
11 * test it. 16 * test it.
12 */ 17 */
13extern int 18int
14start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, 19start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
15 unsigned migratetype); 20 unsigned migratetype);
16 21
@@ -18,7 +23,7 @@ start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
18 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. 23 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
19 * target range is [start_pfn, end_pfn) 24 * target range is [start_pfn, end_pfn)
20 */ 25 */
21extern int 26int
22undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, 27undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
23 unsigned migratetype); 28 unsigned migratetype);
24 29
@@ -30,8 +35,8 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);
30/* 35/*
31 * Internal functions. Changes pageblock's migrate type. 36 * Internal functions. Changes pageblock's migrate type.
32 */ 37 */
33extern int set_migratetype_isolate(struct page *page); 38int set_migratetype_isolate(struct page *page);
34extern void unset_migratetype_isolate(struct page *page, unsigned migratetype); 39void unset_migratetype_isolate(struct page *page, unsigned migratetype);
35 40
36 41
37#endif 42#endif