From 0a475ab309bacffc7d2c6ac9bcd480ba77666872 Mon Sep 17 00:00:00 2001 From: Charan Teja Reddy Date: Wed, 27 Nov 2019 18:32:48 +0530 Subject: [PATCH] mm: correct ALLOC_WMARK_MIN flag check for atomic allocations ALLOC_WMARK_[MIN|LOW|HIGH] are the indexes into the zones->_watermark array. Use ALLOC_WMARK_MASK to get a particular water mark alloc flag. Correct this logic for atomic order-0 allocations watermark check. Change-Id: I5a74abd579df2ddcca63fdd99a090ca83ccd481c Fixes: 6b274863bca8 ("mm: ignore boosting for min watermark") Signed-off-by: Charan Teja Reddy --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 47a10f488b66..2f756ca4eb3c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3781,7 +3781,7 @@ retry: * 3) ALLOC_HARDER - Allow (__GFP_ATOMIC && !__GFP_NOMEMALLOC), * of the others. */ - if (unlikely(!order && (alloc_flags & ALLOC_WMARK_MIN) && + if (unlikely(!order && !(alloc_flags & ALLOC_WMARK_MASK) && (alloc_flags & (ALLOC_HARDER | ALLOC_HIGH)))) { mark = zone->_watermark[WMARK_MIN]; }