mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
f9899c0281
During the kernel booting, the generic cpu_to_node() is called too early in arm64, powerpc and riscv when CONFIG_NUMA is enabled. There are at least four places in the common code where the generic cpu_to_node() is called before it is initialized: 1.) early_trace_init() in kernel/trace/trace.c 2.) sched_init() in kernel/sched/core.c 3.) init_sched_fair_class() in kernel/sched/fair.c 4.) workqueue_init_early() in kernel/workqueue.c This will harm performance since there is an increase in off node accesses. In order to fix the bug, the patch introduces early_numa_node_init() which is called after smp_prepare_boot_cpu() in start_kernel. early_numa_node_init will initialize the "numa_node" as soon as the early_cpu_to_node() is ready, before the cpu_to_node() is called at the first time. Link: https://lkml.kernel.org/r/20240126064451.5465-1-shijie@os.amperecomputing.com Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> [RISC-V] Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Josh Poimboeuf <jpoimboe@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Kelley (LINUX) <mikelley@microsoft.com> Cc: "Mike Rapoport (IBM)" <rppt@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Rafael J. Wysocki <rafael@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Valentin Schneider <vschneid@redhat.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Will Deacon <will@kernel.org> Cc: Yury Norov <yury.norov@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
||
---|---|---|
.. | ||
.gitignore | ||
build-version | ||
calibrate.c | ||
do_mounts_initrd.c | ||
do_mounts_rd.c | ||
do_mounts.c | ||
do_mounts.h | ||
init_task.c | ||
initramfs.c | ||
Kconfig | ||
main.c | ||
Makefile | ||
noinitramfs.c | ||
version-timestamp.c | ||
version.c |