Re: [PATCH v3 1/2] x86/mm: Handle alloc failure in phys_*_init()

From: Em Sharnoff
Date: Fri Jun 13 2025 - 16:17:49 EST


On 6/11/25 20:36, Dave Hansen wrote:
> On 6/11/25 12:26, Em Sharnoff wrote:
> > 2. Change the phys_*_init() functions to return int, and directly update
> > max_pfn_mapped from within them. They already call update_page_count(),
> > maybe this is similar?
>
> That seems like the most straightforward. Each time they update a
> mapping, they call a helper which bumps up 'max_pfn_mapped'.

Update on this -- turns out I was wrong again. 'paddr_last' is also used to
update 'pfn_mapped', which is more complex. Hopefully still within reason.

I've posted a new patch set, patch 1/4 adopts the "call a helper" route.
Design-wise, it's less clean than I'd like, but let me know what you think.
https://lore.kernel.org/all/7d0d307d-71eb-4913-8023-bccc7a8a4a3d@xxxxxxxxx/

Em