Skip to content

Commit 6b9f29b

Browse files
Alexandre Ghitidennisszhou
authored andcommitted
riscv: Enable pcpu page first chunk allocator
As explained in commit 6ea529a ("percpu: make embedding first chunk allocator check vmalloc space size"), the embedding first chunk allocator needs the vmalloc space to be larger than the maximum distance between units which are grouped into NUMA nodes. On a very sparse NUMA configurations and a small vmalloc area (for example, it is 64GB in sv39), the allocation of dynamic percpu data in the vmalloc area could fail. So provide the pcpu page allocator as a fallback in case we fall into such a sparse configuration (which happened in arm64 as shown by commit 09cea61 ("arm64: support page mapping percpu first chunk allocator")). Signed-off-by: Alexandre Ghiti <[email protected]> Signed-off-by: Dennis Zhou <[email protected]>
1 parent 7a92fc8 commit 6b9f29b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

arch/riscv/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ config NUMA
414414
depends on SMP && MMU
415415
select ARCH_SUPPORTS_NUMA_BALANCING
416416
select GENERIC_ARCH_NUMA
417+
select HAVE_SETUP_PER_CPU_AREA
417418
select NEED_PER_CPU_EMBED_FIRST_CHUNK
419+
select NEED_PER_CPU_PAGE_FIRST_CHUNK
418420
select OF_NUMA
419421
select USE_PERCPU_NUMA_NODE_ID
420422
help

arch/riscv/mm/kasan_init.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,14 @@ static void __init kasan_shallow_populate(void *start, void *end)
438438
kasan_shallow_populate_pgd(vaddr, vend);
439439
}
440440

441+
#ifdef CONFIG_KASAN_VMALLOC
442+
void __init kasan_populate_early_vm_area_shadow(void *start, unsigned long size)
443+
{
444+
kasan_populate(kasan_mem_to_shadow(start),
445+
kasan_mem_to_shadow(start + size));
446+
}
447+
#endif
448+
441449
static void __init create_tmp_mapping(void)
442450
{
443451
void *ptr;

0 commit comments

Comments
 (0)