Re: [PATCH 3/4] mm/mm_init: drop deferred_init_maxorder()

From: Mike Rapoport
Date: Tue Aug 19 2025 - 06:39:36 EST


On Tue, Aug 19, 2025 at 09:22:54AM +0000, Wei Yang wrote:
> On Tue, Aug 19, 2025 at 09:54:22AM +0200, David Hildenbrand wrote:
> >> -static unsigned long __init
> >> -deferred_init_memmap_chunk(unsigned long start_pfn, unsigned long end_pfn,
> >> - struct zone *zone)
> >> -{
> >> - unsigned long nr_pages = 0;
> >> - unsigned long spfn, epfn;
> >> - u64 i = 0;
> >> + while (spfn < epfn) {
> >> + unsigned long mo_pfn = ALIGN(spfn + 1, MAX_ORDER_NR_PAGES);
> >> + unsigned long chunk_end = min(mo_pfn, epfn);
> >> - deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn, start_pfn);
> >> + nr_pages += deferred_init_pages(zone, spfn, chunk_end);
> >> + deferred_free_pages(spfn, chunk_end - spfn);
> >
> >
> >I assume the expectation is that all PFNs in the start_pfn -> end_pfn range
> >will go to this zone, correct?
>
> I think so.
>
> defer_init only apply to the highest zone in one node.

Right, we defer initialization of last zone in every node and there is a
thread per node that does the initialization.

--
Sincerely yours,
Mike.