From 3c72e2d1a71628ee4669875a79df42029af96e6e Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Thu, 1 Sep 2022 16:26:36 +0800 Subject: [PATCH] mm/huge_memory: remove outdated VM_WARN_ON_ONCE_PAGE from unmap_page() mainline inclusion from mainline-v5.19-rc1 commit 500539419fae0aeb27189b2d62a238a056ca6742 category: bugfix bugzilla: 187533, https://gitee.com/openeuler/kernel/issues/I5OITX CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=500539419fae0aeb27189b2d62a238a056ca6742 -------------------------------- We can already theoretically fail to unmap (still having page_mapped()) in case arch_unmap_one() fails, which can happen on sparc. Failures to unmap are handled gracefully, just as if there are other references on the target page: freezing the refcount in split_huge_page_to_list() will fail if still mapped and we'll simply remap. In commit 504e070dc08f ("mm: thp: replace DEBUG_VM BUG with VM_WARN when unmap fails for split") we already converted to VM_WARN_ON_ONCE_PAGE, let's get rid of it completely now. This is a preparation for making try_to_migrate() fail on anonymous pages with GUP pins, which will make this VM_WARN_ON_ONCE_PAGE trigger more frequently. Link: https://lkml.kernel.org/r/20220428083441.37290-11-david@redhat.com Signed-off-by: David Hildenbrand Reported-by: Yang Shi Reviewed-by: Yang Shi Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Ma Wupeng Reviewed-by: Kefeng Wang Signed-off-by: Zheng Zengkai --- mm/huge_memory.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index fdd617e8197d..e6f1903f6f63 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2379,8 +2379,6 @@ static void unmap_page(struct page *page) ttu_flags |= TTU_SPLIT_FREEZE; try_to_unmap(page, ttu_flags); - - VM_WARN_ON_ONCE_PAGE(page_mapped(page), page); } static void remap_page(struct page *page, unsigned int nr) -- GitLab