mm: remove redundant clear page when CONFIG_INIT_ON_ALLOC_DEFAULT_ON configured
Commit Message
From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
There will be redundant clear page within vma_alloc_zeroed_movable_folio
when CONFIG_INIT_ON_ALLOC_DEFAULT_ON is on. Remove it by judging related
configs.
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
include/linux/highmem.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -227,7 +227,7 @@ struct folio *vma_alloc_zeroed_movable_folio(struct vm_area_struct *vma,
struct folio *folio;
folio = vma_alloc_folio(GFP_HIGHUSER_MOVABLE, 0, vma, vaddr, false);
- if (folio)
+ if (folio && !want_init_on_alloc(GFP_HIGHUSER_MOVABLE))
clear_user_highpage(&folio->page, vaddr);
return folio;