BACKPORT: mm: remove PageAnonExclusive assertions in unuse_pte()

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>
(cherry picked from commit 8d294a8c63)
[ Fix trivial conflict in mm/swapfile.c - Kalesh Singh ]
Bug: 313807618
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Change-Id: I932718a3dbe7216c6119ff666406ff0661a97298
This commit is contained in:
Matthew Wilcox (Oracle) 2023-12-12 16:48:13 +00:00 committed by Kalesh Singh
parent fe52579d8c
commit 38de31bd03

View File

@ -1809,10 +1809,6 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
*/
arch_swap_restore(folio_swap(entry, folio), folio);
/* 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);