From 89d1eee5326f6f054606e6f82aaf2025731b6686 Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Fri, 3 Feb 2012 15:37:18 -0800 Subject: [PATCH] --- yaml --- r: 287219 b: refs/heads/master c: 0bf380bc70ecba68cb4d74dc656cc2fa8c4d801a h: refs/heads/master i: 287217: 3de6f9683940419b990499f37651541facfa3c24 287215: 0a46735f59b9c46790e0307b14aafb1e9daeeed7 v: v3 --- [refs] | 2 +- trunk/mm/compaction.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 24ea348b35c0..eb06c8b5266b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3deaa7190a8da38453c4fabd9dec7f66d17fff67 +refs/heads/master: 0bf380bc70ecba68cb4d74dc656cc2fa8c4d801a diff --git a/trunk/mm/compaction.c b/trunk/mm/compaction.c index 71a58f67f481..bd939a574b84 100644 --- a/trunk/mm/compaction.c +++ b/trunk/mm/compaction.c @@ -313,6 +313,19 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, } else if (!locked) spin_lock_irq(&zone->lru_lock); + /* + * migrate_pfn does not necessarily start aligned to a + * pageblock. Ensure that pfn_valid is called when moving + * into a new MAX_ORDER_NR_PAGES range in case of large + * memory holes within the zone + */ + if ((low_pfn & (MAX_ORDER_NR_PAGES - 1)) == 0) { + if (!pfn_valid(low_pfn)) { + low_pfn += MAX_ORDER_NR_PAGES - 1; + continue; + } + } + if (!pfn_valid_within(low_pfn)) continue; nr_scanned++;