Re: [PATCH v2 1/5] mm/sparse-vmemmap: provide generic vmemmap_set_pmd() and vmemmap_check_pmd()
From: David Hildenbrand (Arm)
Date: Fri Apr 24 2026 - 08:29:56 EST
On 4/9/26 12:44, Mike Rapoport wrote:
> On Sun, Apr 05, 2026 at 10:07:36PM +0800, Muchun Song wrote:
>>>
>>> Do we have to crash the kernel here?
>>> Wouldn't be better to make vmemmap_set_pmd() return error and make
>>> vmemmap_populate_hugepages() fall back to base pages in case
>>> vmemmap_set_pmd() errored?
>>
>> Hi Mike,
>>
>> Thanks for the review. Let me explain my original thought process here.
>>
>> My assumption was that pmd_set_huge() for the kernel virtual address space
>> should rarely, if ever, fail in this context. Furthermore, if we look at the
>> architectures this patch replaces (e.g., arm64 and riscv), they are either
>> ignoring the return value of pmd_set_huge() entirely or lacking any graceful
>> fallback mechanism anyway.
>>
>> So, to keep the initial generic implementation as simple as possible, I used
>> BUG_ON() as a strict assertion.
>
> Fair enough, let's just make it VM_BUG_ON().
VM_WARN_ON_* please.
--
Cheers,
David