[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99d0e61b-9408-490c-8634-f44cb2487d96@redhat.com>
Date: Wed, 23 Oct 2024 20:50:21 +0200
From: David Hildenbrand <david@...hat.com>
To: Zi Yan <ziy@...dia.com>, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>
Cc: usamaarif642@...il.com, baohua@...nel.org, cerasuolodomenico@...il.com,
corbet@....net, hannes@...xchg.org, kernel-team@...a.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, npache@...hat.com,
riel@...riel.com, roman.gushchin@...ux.dev, rppt@...nel.org,
ryan.roberts@....com, ryncsn@...il.com, shakeel.butt@...ux.dev,
willy@...radead.org, yuzhao@...gle.com
Subject: Re: [PATCH] mm: avoid VM_BUG_ON when try to map an anon large folio
to zero page.
On 23.10.24 19:12, Zi Yan wrote:
> An anonymous large folio can be split into non order-0 folios,
> try_to_map_unused_to_zeropage() should not VM_BUG_ON compound pages but
> just return false. This fixes the crash when splitting anonymous large
> folios to non order-0 folios.
>
> Fixes: b1f202060afe ("mm: remap unused subpages to shared zeropage when splitting isolated thp")
> Signed-off-by: Zi Yan <ziy@...dia.com>
> ---
> mm/migrate.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index e950fd62607f..7ffdbe078aa7 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -206,7 +206,8 @@ static bool try_to_map_unused_to_zeropage(struct page_vma_mapped_walk *pvmw,
> pte_t newpte;
> void *addr;
>
> - VM_BUG_ON_PAGE(PageCompound(page), page);
> + if (PageCompound(page))
> + return false;
> VM_BUG_ON_PAGE(!PageAnon(page), page);
> VM_BUG_ON_PAGE(!PageLocked(page), page);
> VM_BUG_ON_PAGE(pte_present(*pvmw->pte), page);
Would read nicer in 2024 when working on folios ;)
Acked-by: David Hildenbrand <david@...hat.com>
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists