zone = page_zone(page);
order = page_order(page);
+ mt = get_pageblock_migratetype(page);
- if (get_pageblock_migratetype(page) != MIGRATE_ISOLATE) {
+ if (mt != MIGRATE_ISOLATE) {
/* Obey watermarks as if the page was being allocated */
watermark = low_wmark_pages(zone) + (1 << order);
if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
return 0;
+
+ __mod_zone_freepage_state(zone, -(1UL << order), mt);
}
/* Remove page from free list */
zone->free_area[order].nr_free--;
rmv_page_order(page);
- mt = get_pageblock_migratetype(page);
- if (unlikely(mt != MIGRATE_ISOLATE))
- __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt);
-
if (alloc_order != order)
expand(zone, page, alloc_order, order,
&zone->free_area[order], migratetype);