Skip to content

Commit bc83501

Browse files
aagittorvalds
authored andcommitted
thp: transhuge isolate_migratepages()
It's not worth migrating transparent hugepages during compaction. Those hugepages don't create fragmentation. Signed-off-by: Andrea Arcangeli <[email protected]> Acked-by: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 5d68924 commit bc83501

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

mm/compaction.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,25 @@ static unsigned long isolate_migratepages(struct zone *zone,
295295
continue;
296296
}
297297

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+
298311
/* Try isolate the page */
299312
if (__isolate_lru_page(page, ISOLATE_BOTH, 0) != 0)
300313
continue;
301314

315+
VM_BUG_ON(PageTransCompound(page));
316+
302317
/* Successfully isolated */
303318
del_page_from_lru_list(zone, page, page_lru(page));
304319
list_add(&page->lru, migratelist);

0 commit comments

Comments
 (0)