From: Andrea Arcangeli Date: Thu, 13 Jan 2011 23:47:08 +0000 (-0800) Subject: thp: transhuge isolate_migratepages() X-Git-Tag: 2.1b_release~5588 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc835011afbea3957217ee716093d791fb2fe44f;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git thp: transhuge isolate_migratepages() It's not worth migrating transparent hugepages during compaction. Those hugepages don't create fragmentation. Signed-off-by: Andrea Arcangeli Acked-by: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/compaction.c b/mm/compaction.c index b0fbfdf..da25b5a 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -295,10 +295,25 @@ static unsigned long isolate_migratepages(struct zone *zone, continue; } + if (!PageLRU(page)) + continue; + + /* + * PageLRU is set, and lru_lock excludes isolation, + * splitting and collapsing (collapsing has already + * happened if PageLRU is set). + */ + if (PageTransHuge(page)) { + low_pfn += (1 << compound_order(page)) - 1; + continue; + } + /* Try isolate the page */ if (__isolate_lru_page(page, ISOLATE_BOTH, 0) != 0) continue; + VM_BUG_ON(PageTransCompound(page)); + /* Successfully isolated */ del_page_from_lru_list(zone, page, page_lru(page)); list_add(&page->lru, migratelist);