diff mbox series

mm: Remove PageAnonExclusive assertions in unuse_pte()

Message ID 20231212164813.2540119-1-willy@infradead.org (mailing list archive)
State New
Headers show
Series mm: Remove PageAnonExclusive assertions in unuse_pte() | expand

Commit Message

Matthew Wilcox Dec. 12, 2023, 4:48 p.m. UTC
The page in question is either freshly allocated or known to be in
the swap cache; these assertions are not particularly useful.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/swapfile.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

David Hildenbrand Dec. 12, 2023, 4:49 p.m. UTC | #1
On 12.12.23 17:48, Matthew Wilcox (Oracle) wrote:
> The page in question is either freshly allocated or known to be in
> the swap cache; these assertions are not particularly useful.
> 

They fortunately never triggered, so it's all stable no.

> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>   mm/swapfile.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 0371b7b3cd27..85f9c355cb99 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -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);

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 0371b7b3cd27..85f9c355cb99 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -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);