Re: [PATCH] mm: fix __vm_normal_page() to handle missing support for pmd_special()/pud_special()
From: David Hildenbrand (Arm)
Date: Tue May 05 2026 - 10:36:59 EST
On 5/5/26 14:20, Lorenzo Stoakes wrote:
> On Thu, Apr 30, 2026 at 01:31:22PM +0200, David Hildenbrand (Arm) wrote:
>> On x86 32-bit with THP enabled, zap_huge_pmd() is seen to generate a
>> "WARNING: mm/memory.c:735 at __vm_normal_page+0x6a/0x7d", from the
>> VM_WARN_ON_ONCE(is_zero_pfn(pfn) || is_huge_zero_pfn(pfn)); followed
>> by "BUG: Bad rss-counter state"s, then later "BUG: Bad page state"s
>> when reclaim gets to call shrink_huge_zero_folio_scan().
>>
>> It's as if the _PAGE_SPECIAL bit never got set in the huge_zero pmd:
>> and indeed, whereas pte_special() and pte_mkspecial() are subject to a
>> dedicated CONFIG_ARCH_HAS_PTE_SPECIAL, pmd_special() and pmd_mkspecial()
>> are subject to CONFIG_ARCH_SUPPORTS_PMD_PFNMAP, which is never enabled
>> on any 32-bit architecture.
>
> Ah damn. I wonder if it's really a combination of 'supports THP' and 'has a
> spare software defined bit free in PTE'?
>
I think it's mostly "we have a spare bit (pte_special() implemented), but we
didn't wire up pmd_special()"
Thanks!
--
Cheers,
David