summaryrefslogtreecommitdiffstats
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2011-01-13 15:47:08 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 17:32:45 -0800
commitbc835011afbea3957217ee716093d791fb2fe44f (patch)
tree50d1f2ffb4c1ff8cef4c9fb7fb115faeed0d0339 /mm/compaction.c
parent5d6892407cab23d4bf2f6de065ca351a53849323 (diff)
thp: transhuge isolate_migratepages()
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>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index b0fbfdfad29..da25b5a2e47 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);