ascend inclusion category: Feature bugzilla: https://gitee.com/openeuler/kernel/issues/I7YF5R
---------------------------------------------
The hagepages remap to userspace is specail map and no need to clean the rmap and manage the dirty bit.
Signed-off-by: Wang Wensheng wangwensheng4@huawei.com --- mm/hugetlb.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 51bc04b37665..5b2750ce30e6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -34,6 +34,7 @@ #include <linux/nospec.h> #include <linux/delayacct.h> #include <linux/memory.h> +#include <linux/share_pool.h>
#include <asm/page.h> #include <asm/pgalloc.h> @@ -5474,6 +5475,13 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct
pte = huge_ptep_get_and_clear(mm, address, ptep); tlb_remove_huge_tlb_entry(h, tlb, ptep, address); + + /* sharepool k2u mapped pages are marked special */ + if (sp_check_vm_share_pool(vma->vm_flags) && pte_special(pte)) { + spin_unlock(ptl); + continue; + } + if (huge_pte_dirty(pte)) set_page_dirty(page); /* Leave a uffd-wp pte marker if needed */