From: Usama Arif <usamaarif642@gmail.com>
To: Zi Yan <ziy@nvidia.com>,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Cc: baohua@kernel.org, cerasuolodomenico@gmail.com, corbet@lwn.net,
david@redhat.com, hannes@cmpxchg.org, kernel-team@meta.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
npache@redhat.com, riel@surriel.com, roman.gushchin@linux.dev,
rppt@kernel.org, ryan.roberts@arm.com, ryncsn@gmail.com,
shakeel.butt@linux.dev, willy@infradead.org, yuzhao@google.com
Subject: Re: [PATCH] mm: avoid VM_BUG_ON when try to map an anon large folio to zero page.
Date: Wed, 23 Oct 2024 20:59:16 +0100 [thread overview]
Message-ID: <71c0c05b-d731-48c2-8023-5c7cda3518a1@gmail.com> (raw)
In-Reply-To: <20241023171236.1122535-1-ziy@nvidia.com>
On 23/10/2024 18: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@nvidia.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);
Thanks for fixing it!
Acked-by: Usama Arif <usamaarif642@gmail.com>
prev parent reply other threads:[~2024-10-23 19:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 17:12 Zi Yan
2024-10-23 18:50 ` David Hildenbrand
2024-10-23 19:59 ` Usama Arif [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=71c0c05b-d731-48c2-8023-5c7cda3518a1@gmail.com \
--to=usamaarif642@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=cerasuolodomenico@gmail.com \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npache@redhat.com \
--cc=riel@surriel.com \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=ryncsn@gmail.com \
--cc=shakeel.butt@linux.dev \
--cc=willy@infradead.org \
--cc=yuzhao@google.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox