diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 272c6de1bf4e..9c9194959271 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2238,27 +2238,12 @@ static int move_freepages(struct zone *zone, | |||
2238 | unsigned int order; | 2238 | unsigned int order; |
2239 | int pages_moved = 0; | 2239 | int pages_moved = 0; |
2240 | 2240 | ||
2241 | #ifndef CONFIG_HOLES_IN_ZONE | ||
2242 | /* | ||
2243 | * page_zone is not safe to call in this context when | ||
2244 | * CONFIG_HOLES_IN_ZONE is set. This bug check is probably redundant | ||
2245 | * anyway as we check zone boundaries in move_freepages_block(). | ||
2246 | * Remove at a later date when no bug reports exist related to | ||
2247 | * grouping pages by mobility | ||
2248 | */ | ||
2249 | VM_BUG_ON(pfn_valid(page_to_pfn(start_page)) && | ||
2250 | pfn_valid(page_to_pfn(end_page)) && | ||
2251 | page_zone(start_page) != page_zone(end_page)); | ||
2252 | #endif | ||
2253 | for (page = start_page; page <= end_page;) { | 2241 | for (page = start_page; page <= end_page;) { |
2254 | if (!pfn_valid_within(page_to_pfn(page))) { | 2242 | if (!pfn_valid_within(page_to_pfn(page))) { |
2255 | page++; | 2243 | page++; |
2256 | continue; | 2244 | continue; |
2257 | } | 2245 | } |
2258 | 2246 | ||
2259 | /* Make sure we are not inadvertently changing nodes */ | ||
2260 | VM_BUG_ON_PAGE(page_to_nid(page) != zone_to_nid(zone), page); | ||
2261 | |||
2262 | if (!PageBuddy(page)) { | 2247 | if (!PageBuddy(page)) { |
2263 | /* | 2248 | /* |
2264 | * We assume that pages that could be isolated for | 2249 | * We assume that pages that could be isolated for |
@@ -2273,6 +2258,10 @@ static int move_freepages(struct zone *zone, | |||
2273 | continue; | 2258 | continue; |
2274 | } | 2259 | } |
2275 | 2260 | ||
2261 | /* Make sure we are not inadvertently changing nodes */ | ||
2262 | VM_BUG_ON_PAGE(page_to_nid(page) != zone_to_nid(zone), page); | ||
2263 | VM_BUG_ON_PAGE(page_zone(page) != zone, page); | ||
2264 | |||
2276 | order = page_order(page); | 2265 | order = page_order(page); |
2277 | move_to_free_area(page, &zone->free_area[order], migratetype); | 2266 | move_to_free_area(page, &zone->free_area[order], migratetype); |
2278 | page += 1 << order; | 2267 | page += 1 << order; |