aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2009-09-21 20:01:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 10:17:26 -0400
commit8e7e40d9658cf7b2ae2b76484e235799b3ddaa97 (patch)
tree7dfc66d7878d5d4df8f29c56f9195f653626c378 /mm/page_alloc.c
parent6fb332fabd7288af9dbe7992394aa6ba97c1a537 (diff)
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>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8a8302711725..7b4d4e4ea64f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4906,13 +4906,16 @@ int set_migratetype_isolate(struct page *page)
4906 struct zone *zone; 4906 struct zone *zone;
4907 unsigned long flags; 4907 unsigned long flags;
4908 int ret = -EBUSY; 4908 int ret = -EBUSY;
4909 int zone_idx;
4909 4910
4910 zone = page_zone(page); 4911 zone = page_zone(page);
4912 zone_idx = zone_idx(zone);
4911 spin_lock_irqsave(&zone->lock, flags); 4913 spin_lock_irqsave(&zone->lock, flags);
4912 /* 4914 /*
4913 * In future, more migrate types will be able to be isolation target. 4915 * In future, more migrate types will be able to be isolation target.
4914 */ 4916 */
4915 if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE) 4917 if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE &&
4918 zone_idx != ZONE_MOVABLE)
4916 goto out; 4919 goto out;
4917 set_pageblock_migratetype(page, MIGRATE_ISOLATE); 4920 set_pageblock_migratetype(page, MIGRATE_ISOLATE);
4918 move_freepages_block(zone, page, MIGRATE_ISOLATE); 4921 move_freepages_block(zone, page, MIGRATE_ISOLATE);