linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: remove redundant clear page when CONFIG_INIT_ON_ALLOC_DEFAULT_ON configured
@ 2023-09-11 10:49 zhaoyang.huang
  2023-09-11 12:12 ` Michal Hocko
  0 siblings, 1 reply; 5+ messages in thread
From: zhaoyang.huang @ 2023-09-11 10:49 UTC (permalink / raw)
  To: Andrew Morton, Matthew Wilcox, Michal Hocko, linux-mm,
	linux-kernel, Zhaoyang Huang, ke.wang

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(-)

diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 99c474de800d..3926f8414729 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -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;
-- 
2.25.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-11 13:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11 10:49 [PATCH] mm: remove redundant clear page when CONFIG_INIT_ON_ALLOC_DEFAULT_ON configured zhaoyang.huang
2023-09-11 12:12 ` Michal Hocko
2023-09-11 12:24   ` Michal Hocko
2023-09-11 12:47   ` Matthew Wilcox
2023-09-11 13:03     ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox