Re: [PATCH v2] mm: allow deferred page init for vmemmap only

From: Michal Hocko
Date: Thu May 10 2018 - 08:30:47 EST

On Thu 10-05-18 07:53:56, Pavel Tatashin wrote:
> Here is a sample path, where translation is required, that occurs before
> mm_init():
> start_kernel()
> trap_init()
> setup_cpu_entry_areas()
> setup_cpu_entry_area(cpu)
> get_cpu_gdt_paddr(cpu)
> per_cpu_ptr_to_phys(addr)
> pcpu_addr_to_page(addr)
> virt_to_page(addr)
> pfn_to_page(__pa(addr) >> PAGE_SHIFT)

Thanks that helped me to see the problem. On the other hand isn't this a
bit of an overkill? AFAICS this affects only NEED_PER_CPU_KM which is !SMP
and DEFERRED_STRUCT_PAGE_INIT makes only very limited sense on UP,

Or do we have more such places?
Michal Hocko