Re: [PATCH v2 4/7] mm/page_ext: use common allocation and initialization entry points
From: Mike Rapoport
Date: Wed Nov 18 2026 - 09:19:07 EST
On Tue, Nov 17, 2026 at 08:06:24PM +0800, Muchun Song wrote:
> FLATMEM uses separate page_ext_init_flatmem() and
> page_ext_init_flatmem_late() entry points, while SPARSEMEM performs its
> work through page_ext_init(). This exposes the memory model in the
> generic boot sequence and obscures the allocation and client
> initialization phases.
>
> Rename the early entry point to page_ext_alloc() and use
> page_ext_init() for client callbacks in both memory models. SPARSEMEM
> keeps its existing late allocation behavior for now; its
> page_ext_alloc() remains an empty configuration stub.
>
> This also moves FLATMEM client callbacks from immediately after
> kmem_cache_init() to after vmalloc_init(). The callbacks still run
> after the buddy and slab allocators are available, as required by
> page_owner.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
> ---
> v2:
> - Split the common allocation and initialization entry points into a
> preparatory patch
> - Document the later FLATMEM client callback timing (noted by Chris
> Down)
> ---
> include/linux/page_ext.h | 20 +++++---------------
> mm/mm_init.c | 7 +------
> mm/page_ext.c | 5 ++---
> 3 files changed, 8 insertions(+), 24 deletions(-)
--
Sincerely yours,
Mike.