diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2011-12-29 07:09:50 -0500 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-05-21 09:09:30 -0400 |
commit | ff9543fd32060917beb080b1eb2d1d41ec7f39e0 (patch) | |
tree | 31d2ff2026353945cc6f574148c54b4d53167a3b /mm/internal.h | |
parent | 85aa125f001f87f96a72e9e6ee515490843b1202 (diff) |
mm: compaction: export some of the functions
This commit exports some of the functions from compaction.c file
outside of it adding their declaration into internal.h header
file so that other mm related code can use them.
This forced compaction.c to always be compiled (as opposed to being
compiled only if CONFIG_COMPACTION is defined) but as to avoid
introducing code that user did not ask for, part of the compaction.c
is now wrapped in on #ifdef.
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 'mm/internal.h')
-rw-r--r-- | mm/internal.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mm/internal.h b/mm/internal.h index 2189af491783..aee4761cf9a9 100644 --- a/mm/internal.h +++ b/mm/internal.h | |||
@@ -100,6 +100,39 @@ extern void prep_compound_page(struct page *page, unsigned long order); | |||
100 | extern bool is_free_buddy_page(struct page *page); | 100 | extern bool is_free_buddy_page(struct page *page); |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #if defined CONFIG_COMPACTION || defined CONFIG_CMA | ||
104 | |||
105 | /* | ||
106 | * in mm/compaction.c | ||
107 | */ | ||
108 | /* | ||
109 | * compact_control is used to track pages being migrated and the free pages | ||
110 | * they are being migrated to during memory compaction. The free_pfn starts | ||
111 | * at the end of a zone and migrate_pfn begins at the start. Movable pages | ||
112 | * are moved to the end of a zone during a compaction run and the run | ||
113 | * completes when free_pfn <= migrate_pfn | ||
114 | */ | ||
115 | struct compact_control { | ||
116 | struct list_head freepages; /* List of free pages to migrate to */ | ||
117 | struct list_head migratepages; /* List of pages being migrated */ | ||
118 | unsigned long nr_freepages; /* Number of isolated free pages */ | ||
119 | unsigned long nr_migratepages; /* Number of pages to migrate */ | ||
120 | unsigned long free_pfn; /* isolate_freepages search base */ | ||
121 | unsigned long migrate_pfn; /* isolate_migratepages search base */ | ||
122 | bool sync; /* Synchronous migration */ | ||
123 | |||
124 | int order; /* order a direct compactor needs */ | ||
125 | int migratetype; /* MOVABLE, RECLAIMABLE etc */ | ||
126 | struct zone *zone; | ||
127 | }; | ||
128 | |||
129 | unsigned long | ||
130 | isolate_freepages_range(unsigned long start_pfn, unsigned long end_pfn); | ||
131 | unsigned long | ||
132 | isolate_migratepages_range(struct zone *zone, struct compact_control *cc, | ||
133 | unsigned long low_pfn, unsigned long end_pfn); | ||
134 | |||
135 | #endif | ||
103 | 136 | ||
104 | /* | 137 | /* |
105 | * function for dealing with page's order in buddy system. | 138 | * function for dealing with page's order in buddy system. |