From 84da19e51f242803b532d1256f87565d29a29506 Mon Sep 17 00:00:00 2001 From: Charan Teja Reddy Date: Thu, 5 Mar 2020 17:57:49 +0530 Subject: [PATCH] mm: allocate swapin pages from movable zone We allow pages to movable zone only when __GFP_CMA is set along with other required flags. When an anon page first allocated will go to the movable zone but when the same is swapped out and then swapin is not allowed to go. Fix it. Fixes: 0157fbd79dbe ("mm: Allow only __GFP_CMA allocations from Movable zone") Change-Id: I746299259a91819499e948ca34fe8880c8eaa175 Signed-off-by: Charan Teja Reddy --- mm/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 88e6f145e858..19f8a2a2a852 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3145,8 +3145,8 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) if (!page) { if (skip_swapcache) { - page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, - vmf->address); + page = alloc_page_vma(GFP_HIGHUSER_MOVABLE | __GFP_CMA, + vma, vmf->address); if (page) { __SetPageLocked(page); __SetPageSwapBacked(page);