powerpc/64/mm: implement page mapping percpu first chunk allocator
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Mon, 8 Jun 2020 07:09:02 +0000 (12:39 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 15 Sep 2020 12:13:22 +0000 (22:13 +1000)
commiteb553f16973ade990d05946af9ae191394712c8a
tree096242e59788e589f9832571c0270a0dc43ce553
parent2a32abac8860aa1c3a1fc99973ce67179575b36c
powerpc/64/mm: implement page mapping percpu first chunk allocator

Implement page mapping percpu first chunk allocator as a fallback to
the embedding allocator. With 4K hash translation we limit our page
table range to 64TB and commit: 0034d395f89d ("powerpc/mm/hash64: Map all the
kernel regions in the same 0xc range") moved all kernel mapping to
that 64TB range. In-order to support sparse memory layout we need
to increase our linear mapping space and reduce other mappings.

With such a layout percpu embedded first chunk allocator will fail
because of small vmalloc range. Add a fallback to page mapping
percpu first chunk allocator for such failures.

The below dmesg output can be observed in such case.

 percpu: max_distance=0x1ffffef00000 too large for vmalloc space 0x10000000000
 PERCPU: auto allocator failed (-22), falling back to page size
 percpu: 40 4K pages/cpu s148816 r0 d15024

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200608070904.387440-2-aneesh.kumar@linux.ibm.com
arch/powerpc/Kconfig
arch/powerpc/kernel/setup_64.c