linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/5]memhp: make pages from movable zone always isolatable
@ 2009-06-29  1:47 Shaohua Li
  0 siblings, 0 replies; only message in thread
From: Shaohua Li @ 2009-06-29  1:47 UTC (permalink / raw)
  To: lkml, linux-mm; +Cc: Andrew Morton, cl

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>
---
 mm/page_alloc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux/mm/page_alloc.c
===================================================================
--- linux.orig/mm/page_alloc.c	2009-06-26 09:44:07.000000000 +0800
+++ linux/mm/page_alloc.c	2009-06-26 09:52:03.000000000 +0800
@@ -4900,13 +4900,16 @@ int set_migratetype_isolate(struct page 
 	struct zone *zone;
 	unsigned long flags;
 	int ret = -EBUSY;
+	int zone_idx;
 
 	zone = page_zone(page);
+	zone_idx = zone_idx(zone);
 	spin_lock_irqsave(&zone->lock, flags);
 	/*
 	 * In future, more migrate types will be able to be isolation target.
 	 */
-	if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE)
+	if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE &&
+	    zone_idx != ZONE_MOVABLE)
 		goto out;
 	set_pageblock_migratetype(page, MIGRATE_ISOLATE);
 	move_freepages_block(zone, page, MIGRATE_ISOLATE);


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-29  1:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-29  1:47 [PATCH 3/5]memhp: make pages from movable zone always isolatable Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox