summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2010-05-21 01:14:04 +0200
committerAndrea Arcangeli <aarcange@redhat.com>2010-05-20 23:16:49 +0000
commit0ca2c9c3a96392bdd7ccbc45b52cbe06e986cc17 (patch)
tree609784ce951f9000f61129d78e8ce00493530451
parent387f91bc797fd90c84e92378aa115cd86eca3fcc (diff)
transhuge isolate_migratepages()THP-25-anon_vma_chain
It's not worth migrating transparent hugepages during compaction. Those hugepages don't create fragmentation. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
-rw-r--r--mm/compaction.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index 94cce51b0b35..c5c99e0422f5 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -271,10 +271,25 @@ static unsigned long isolate_migratepages(struct zone *zone,
if (PageBuddy(page))
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);