diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:47:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:45 -0500 |
commit | bc835011afbea3957217ee716093d791fb2fe44f (patch) | |
tree | 50d1f2ffb4c1ff8cef4c9fb7fb115faeed0d0339 /mm/compaction.c | |
parent | 5d6892407cab23d4bf2f6de065ca351a53849323 (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.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index b0fbfdfad298..da25b5a2e476 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -295,10 +295,25 @@ static unsigned long isolate_migratepages(struct zone *zone, | |||
295 | continue; | 295 | continue; |
296 | } | 296 | } |
297 | 297 | ||
298 | if (!PageLRU(page)) | ||
299 | continue; | ||
300 | |||
301 | /* | ||
302 | * PageLRU is set, and lru_lock excludes isolation, | ||
303 | * splitting and collapsing (collapsing has already | ||
304 | * happened if PageLRU is set). | ||
305 | */ | ||
306 | if (PageTransHuge(page)) { | ||
307 | low_pfn += (1 << compound_order(page)) - 1; | ||
308 | continue; | ||
309 | } | ||
310 | |||
298 | /* Try isolate the page */ | 311 | /* Try isolate the page */ |
299 | if (__isolate_lru_page(page, ISOLATE_BOTH, 0) != 0) | 312 | if (__isolate_lru_page(page, ISOLATE_BOTH, 0) != 0) |
300 | continue; | 313 | continue; |
301 | 314 | ||
315 | VM_BUG_ON(PageTransCompound(page)); | ||
316 | |||
302 | /* Successfully isolated */ | 317 | /* Successfully isolated */ |
303 | del_page_from_lru_list(zone, page, page_lru(page)); | 318 | del_page_from_lru_list(zone, page, page_lru(page)); |
304 | list_add(&page->lru, migratelist); | 319 | list_add(&page->lru, migratelist); |