Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id #492

Closed
wants to merge 1 commit into from

Conversation

bjoto
Copy link

@bjoto bjoto commented Jan 22, 2024

Pull request for series with
subject: NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id
version: 1
url: https://patchwork.kernel.org/project/linux-riscv/list/?series=817993

@bjoto
Copy link
Author

bjoto commented Jan 22, 2024

Upstream branch: e5075d8
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=817993
version: 1

@bjoto
Copy link
Author

bjoto commented Jan 22, 2024

Upstream branch: 3a6dd5f
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=817993
version: 1

@bjoto
Copy link
Author

bjoto commented Jan 23, 2024

Upstream branch: 3a6dd5f
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818934
version: 2

@bjoto
Copy link
Author

bjoto commented Jan 23, 2024

Upstream branch: e2d6b54
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818934
version: 2

@bjoto bjoto closed this Jan 24, 2024
@bjoto bjoto reopened this Jan 24, 2024
@bjoto
Copy link
Author

bjoto commented Jan 24, 2024

Upstream branch: e2d6b54
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818934
version: 2

@bjoto
Copy link
Author

bjoto commented Jan 25, 2024

Upstream branch: cb4ede9
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818934
version: 2

@bjoto
Copy link
Author

bjoto commented Jan 26, 2024

Upstream branch: cb4ede9
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=820138
version: 3

@bjoto bjoto added V3 and removed V2 labels Jan 26, 2024
@bjoto bjoto force-pushed the for-next_base branch 3 times, most recently from 86689b1 to 43a5b17 Compare February 22, 2024 20:19
…e id

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

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.

Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
@bjoto
Copy link
Author

bjoto commented Feb 22, 2024

Upstream branch: 45e0b0f
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=820138
version: 3

@bjoto bjoto closed this Feb 28, 2024
@bjoto bjoto deleted the series/817993=>for-next branch March 1, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants