Re: [PATCH 1/1] x86/ioremap: Use is_vmalloc_addr in iounmap

Thomas Gleixner
2024-08-08T18:44:11Z

On Thu, Aug 08 2024 at 09:39, Dan Williams wrote:
> Dan Williams wrote:
>> Apologies was trying to quickly reverse engineer how private memory
>> might be different than typical memremap_pages(), but it is indeed the
>> same in this aspect.
>>
>> So the real difference is that the private memory case tries to
>> allocate physical memory by searching for holes in the iomem_resource
>> starting from U64_MAX. That might explain why only the private memory
>> case is violating assumptions with respect to high_memory spilling into
>> vmalloc space.
>
> Not U64_MAX, but it starts searching for free physical address space
> starting at MAX_PHYSMEM_BITS, see gfr_start().

Wait. MAX_PHYSMEM_BITS is either 46 (4-level) or 52 (5-level), which is
fully covered by the identity map space.

So even if the search starts from top of that space, how do we end up
with high_memory > VMALLOC_START?

That does not make any sense at all.

> That aspect of private memory has always bothered me, but I am not
> sure that is the historical assumption violation you are referring to
> above.

The historical assumption about max_pfn and high_memory is that this is
the end of the actual memory space.

Thanks,

tglx