mm: remove PageAnonExclusive assertions in unuse_pte()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 12 Dec 2023 16:48:13 +0000 (16:48 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 Dec 2023 19:58:25 +0000 (11:58 -0800)
The page in question is either freshly allocated or known to be in
the swap cache; these assertions are not particularly useful.

Link: https://lkml.kernel.org/r/20231212164813.2540119-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swapfile.c

index 0371b7b3cd2752a79300671ade2e3a81676dd533..85f9c355cb996201aa89b8099aed82bb8d4cf574 100644 (file)
@@ -1788,10 +1788,6 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
         */
        arch_swap_restore(entry, page_folio(page));
 
-       /* See do_swap_page() */
-       BUG_ON(!PageAnon(page) && PageMappedToDisk(page));
-       BUG_ON(PageAnon(page) && PageAnonExclusive(page));
-
        dec_mm_counter(vma->vm_mm, MM_SWAPENTS);
        inc_mm_counter(vma->vm_mm, MM_ANONPAGES);
        get_page(page);