From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Chris Down <chris@chrisdown.name>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>,
kernel-team@fb.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/huge_memory: Mark moved huge zero page PMD as special
Date: Wed, 18 Feb 2026 08:53:14 +0100 [thread overview]
Message-ID: <b389647e-67e5-4948-9c59-35bf3f936eee@kernel.org> (raw)
In-Reply-To: <aZU10aBZxCHfmjeB@chrisdown.name>
On 2/18/26 04:45, Chris Down wrote:
> Without pmd_mkspecial(), vm_normal_page_pmd() on architectures with
> CONFIG_ARCH_HAS_PTE_SPECIAL does not recognise the moved huge zero page
> as special, incorrectly treating it as a normal page and corrupting its
> refcount.
>
> Fixes: d82d09e48219 ("mm/huge_memory: mark PMD mappings of the huge zero folio special")
> Cc: stable@vger.kernel.org
> Signed-off-by: Chris Down <chris@chrisdown.name>
> ---
> mm/huge_memory.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index fed57951a7cd..5f908cdb11f1 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2795,6 +2795,7 @@ int move_pages_huge_pmd(struct mm_struct *mm, pmd_t *dst_pmd, pmd_t *src_pmd, pm
> } else {
> src_pmdval = pmdp_huge_clear_flush(src_vma, src_addr, src_pmd);
> _dst_pmd = folio_mk_pmd(page_folio(src_page), dst_vma->vm_page_prot);
> + _dst_pmd = pmd_mkspecial(_dst_pmd);
> }
> set_pmd_at(mm, dst_addr, dst_pmd, _dst_pmd);
>
In theory that's correct, but we should look into just moving the PMD
instead of reconstructing things. See my reply to patch #1.
--
Cheers,
David
prev parent reply other threads:[~2026-02-18 7:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 3:45 Chris Down
2026-02-18 7:53 ` David Hildenbrand (Arm) [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=b389647e-67e5-4948-9c59-35bf3f936eee@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=chris@chrisdown.name \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=stable@vger.kernel.org \
--cc=willy@infradead.org \
/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