diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2012-01-30 07:23:47 -0500 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-05-21 09:09:28 -0400 |
commit | 03d44192f69a45d780ba124f691e76020a44ebae (patch) | |
tree | 81b43ba18b0fa70280a20fa534d37b9d0c5e5478 /mm | |
parent | 2fe86e0004076128f05d5a774b5c9c03d9dc3de2 (diff) |
mm: compaction: introduce map_pages()
This commit creates a map_pages() function which map pages freed
using split_free_pages(). This merely moves some code from
isolate_freepages() so that it can be reused in other places.
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: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/compaction.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index ee20fc044b91..d9d7b35d3933 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -127,6 +127,16 @@ static bool suitable_migration_target(struct page *page) | |||
127 | return false; | 127 | return false; |
128 | } | 128 | } |
129 | 129 | ||
130 | static void map_pages(struct list_head *list) | ||
131 | { | ||
132 | struct page *page; | ||
133 | |||
134 | list_for_each_entry(page, list, lru) { | ||
135 | arch_alloc_page(page, 0); | ||
136 | kernel_map_pages(page, 1, 1); | ||
137 | } | ||
138 | } | ||
139 | |||
130 | /* | 140 | /* |
131 | * Based on information in the current compact_control, find blocks | 141 | * Based on information in the current compact_control, find blocks |
132 | * suitable for isolating free pages from and then isolate them. | 142 | * suitable for isolating free pages from and then isolate them. |
@@ -206,10 +216,7 @@ static void isolate_freepages(struct zone *zone, | |||
206 | } | 216 | } |
207 | 217 | ||
208 | /* split_free_page does not map the pages */ | 218 | /* split_free_page does not map the pages */ |
209 | list_for_each_entry(page, freelist, lru) { | 219 | map_pages(freelist); |
210 | arch_alloc_page(page, 0); | ||
211 | kernel_map_pages(page, 1, 1); | ||
212 | } | ||
213 | 220 | ||
214 | cc->free_pfn = high_pfn; | 221 | cc->free_pfn = high_pfn; |
215 | cc->nr_freepages = nr_freepages; | 222 | cc->nr_freepages = nr_freepages; |