[PATCHv6 11/17] mm/hugetlb: Remove fake head pages

Usama Arif usamaarif642 at gmail.com
Sat Feb 7 14:50:47 PST 2026



On 07/02/2026 21:25, David Hildenbrand (Arm) wrote:
> On 2/7/26 21:16, Usama Arif wrote:
>>
>>> +
>>>   int __meminit vmemmap_populate_hvo(unsigned long addr, unsigned long end,
>>>                          int node, unsigned long headsize)
>>>   {
>>> +    unsigned long maddr, len, tail_pfn;
>>> +    unsigned int order;
>>>       pte_t *pte;
>>> -    unsigned long maddr;
>>> +
>>> +    len = end - addr;
>>> +    order = ilog2(len * sizeof(struct page) / PAGE_SIZE);
>>
>>
>> This doesnt work for ARM. For len = 32 (2MB contiguous-PTE hugetlb on arm64):
>> ilog2(32 * 64 / 65536) = ilog2(2048 / 65536) = ilog2(0) which is undefined.
> 
> HVO should not be possible for that size, and we should never reach that point, no?
> 
> Remember that for HVO, the metadata must span at least two pages.
> 

Ah yeah thats right, ignore me. Its also checked in hugetlb_vmemmap_optimizable_size,
so its all good.



More information about the linux-riscv mailing list