return COMPACT_CONTINUE;
/* Compaction run is not finished if the watermark is not met */
- watermark = low_wmark_pages(zone);
+ watermark = zone->watermark[cc->alloc_flags & ALLOC_WMARK_MASK];
if (!zone_watermark_ok(zone, cc->order, watermark, cc->classzone_idx,
cc->alloc_flags))
if (is_via_compact_memory(order))
return COMPACT_CONTINUE;
- watermark = low_wmark_pages(zone);
+ watermark = zone->watermark[alloc_flags & ALLOC_WMARK_MASK];
/*
* If watermarks for high-order allocation are already met, there
* should be no need for compaction at all.
* This is because during migration, copies of pages need to be
* allocated and for a short time, the footprint is higher
*/
- watermark += (2UL << order);
+ watermark = low_wmark_pages(zone) + (2UL << order);
if (!__zone_watermark_ok(zone, 0, watermark, classzone_idx,
alloc_flags, wmark_target))
return COMPACT_SKIPPED;