diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 918330f71db..1e145ef92c3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1548,8 +1548,9 @@ static inline int should_fail_alloc_page(gfp_t gfp_mask, unsigned int order) static bool __zone_watermark_ok(struct zone *z, int order, unsigned long mark, int classzone_idx, int alloc_flags, long free_pages) { - /* free_pages my go negative - that's OK */ + /* free_pages may go negative - that's OK */ long min = mark; + long lowmem_reserve = z->lowmem_reserve[classzone_idx]; int o; free_pages -= (1 << order) - 1; @@ -1558,7 +1559,7 @@ static bool __zone_watermark_ok(struct zone *z, int order, unsigned long mark, if (alloc_flags & ALLOC_HARDER) min -= min / 4; - if (free_pages <= min + z->lowmem_reserve[classzone_idx]) + if (free_pages <= min + lowmem_reserve) return false; for (o = 0; o < order; o++) { /* At the next order, this order's pages become unavailable */