From: Michal Nazarewicz Date: Mon, 30 Jan 2012 12:23:47 +0000 (+0100) Subject: mm: compaction: introduce map_pages() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03d44192f69a45d780ba124f691e76020a44ebae;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Marek Szyprowski Acked-by: Mel Gorman Reviewed-by: KAMEZAWA Hiroyuki Tested-by: Robert Nelson Tested-by: Barry Song --- 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) return false; } +static void map_pages(struct list_head *list) +{ + struct page *page; + + list_for_each_entry(page, list, lru) { + arch_alloc_page(page, 0); + kernel_map_pages(page, 1, 1); + } +} + /* * Based on information in the current compact_control, find blocks * suitable for isolating free pages from and then isolate them. @@ -206,10 +216,7 @@ static void isolate_freepages(struct zone *zone, } /* split_free_page does not map the pages */ - list_for_each_entry(page, freelist, lru) { - arch_alloc_page(page, 0); - kernel_map_pages(page, 1, 1); - } + map_pages(freelist); cc->free_pfn = high_pfn; cc->nr_freepages = nr_freepages;