Skip to content

Commit

Permalink
thp: transhuge isolate_migratepages()
Browse files Browse the repository at this point in the history
It's not worth migrating transparent hugepages during compaction.  Those
hugepages don't create fragmentation.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
aagit authored and torvalds committed Jan 14, 2011
1 parent 5d68924 commit bc83501
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bc83501

Please sign in to comment.