Skip to content
Snippets Groups Projects
user avatar
Tangquan Zheng authored
Barry Song reported a problem here and provided a RFC patch:
https://lore.kernel.org/linux-mm/20240831092339.66085-1-21cnbao@gmail.com/
do_wp_page() has no ability to reuse mTHP, then it will CoW many small folios while wp fault occurs at a a read-only mTHP (for example, due to fork). This can somtimes waste lots of memory.
David also did that in a more generic approach:
https://lkml.kernel.org/r/20240829165627.2256514-1-david@redhat.com


neither is merged by mm.
Before either David's or Barry's method is ready to be merged into the mainline,we need to submit this GKI hook to support this functionality.

android_vh_reuse_whole_anon_folio ----This vendor hook is used to entirely reuse the whole anonymous mTHP in do_wp_page.
We also need to export the symbol __ptep_set_access_flags because it is called in our vendor hook function.

Bug: 313807618
Change-Id: I366569dd645a4a9e5f14c0d87e3768959e63ae17
Signed-off-by: default avatarTangquan Zheng <zhengtangquan@oppo.com>
482ee073