If direct reclaim failed, unreserve highatomic pageblock
immediately is better than unreserve in should_reclaim_retry().
We may get page in next try rather than reclaim-compact-reclaim-compact...

Signed-off-by: Xishi Qiu <[email protected]>
---
 mm/page_alloc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2331840..2bd19d0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3421,7 +3421,8 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, 
const char *fmt, ...)
        bool drained = false;
 
        *did_some_progress = __perform_reclaim(gfp_mask, order, ac);
-       if (unlikely(!(*did_some_progress)))
+       if (unlikely(!(*did_some_progress)
+           && !unreserve_highatomic_pageblock(ac, false)))
                return NULL;
 
 retry:
-- 
1.8.3.1


Reply via email to