From c946ee4ab03e6bf3c7b92435aaf65ef29f561e4a Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Thu, 8 Dec 2011 14:34:27 -0800 Subject: [PATCH] --- yaml --- r: 276543 b: refs/heads/master c: d021563888312018ca65681096f62e36c20e63cc h: refs/heads/master i: 276541: 53df1bf4e50319f57092dc9f0e95f28433a2a6da 276539: a9bd711fa279e36bc5fdf1865de0249c90b4ac51 276535: 752692aaf0b4650815cde5137023fad5e50b5ecd 276527: 66cc7b13448382fb9b4db1b597e72aa2e5dde080 276511: a156f5cdef7467bf5dd38c4bf1ae1b63966ccc07 276479: fb4d3be6a95f9de1b4e69d9f5ccc5225b084aa7d v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index bb93a0bcb68a..423009b226da 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 09761333ed47e899cc1482c13090b95f3f711971 +refs/heads/master: d021563888312018ca65681096f62e36c20e63cc diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 850009a7101e..2b8ba3aebf6e 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -3377,9 +3377,15 @@ static void setup_zone_migrate_reserve(struct zone *zone) unsigned long block_migratetype; int reserve; - /* Get the start pfn, end pfn and the number of blocks to reserve */ + /* + * Get the start pfn, end pfn and the number of blocks to reserve + * We have to be careful to be aligned to pageblock_nr_pages to + * make sure that we always check pfn_valid for the first page in + * the block. + */ start_pfn = zone->zone_start_pfn; end_pfn = start_pfn + zone->spanned_pages; + start_pfn = roundup(start_pfn, pageblock_nr_pages); reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >> pageblock_order;