Skip to content

Commit 8e7e40d

Browse files
Shaohua Litorvalds
authored andcommitted
memory hotplug: make pages from movable zone always isolatable
Pages on movable zone have two types, MIGRATE_MOVABLE and MIGRATE_RESERVE, both them can be movable, because only movable memory allocation can get pages from movable zone. This makes pages in movable zone always be able to migrate. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Yakui Zhao <yakui.zhao@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6fb332f commit 8e7e40d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎mm/page_alloc.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4906,13 +4906,16 @@ int set_migratetype_isolate(struct page *page)
49064906
struct zone *zone;
49074907
unsigned long flags;
49084908
int ret = -EBUSY;
4909+
int zone_idx;
49094910

49104911
zone = page_zone(page);
4912+
zone_idx = zone_idx(zone);
49114913
spin_lock_irqsave(&zone->lock, flags);
49124914
/*
49134915
* In future, more migrate types will be able to be isolation target.
49144916
*/
4915-
if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE)
4917+
if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE &&
4918+
zone_idx != ZONE_MOVABLE)
49164919
goto out;
49174920
set_pageblock_migratetype(page, MIGRATE_ISOLATE);
49184921
move_freepages_block(zone, page, MIGRATE_ISOLATE);

0 commit comments

Comments
 (0)