[PATCH] init: refactor the generic cpu_to_node for NUMA

Shijie Huang shijie at amperemail.onmicrosoft.com
Thu Jan 18 01:43:14 PST 2024


Hi Greg,

在 2024/1/18 17:27, Greg KH 写道:
> On Thu, Jan 18, 2024 at 11:14:12AM +0800, Huang Shijie wrote:
>> (0) We list the ARCHs which support the NUMA:
>>         arm64, loongarch, powerpc, riscv,
>>         sparc, mips, s390, x86,
> I do not understand this format, what are you saying here?

Sorry for the confusing.


I should put the conclusion at the beginning:

   The generic cpu_to_node() has bug in some situations.

   The generic cpu_to_node()  does not work in arm64, powerpc, riscv 
when the CONFIG_NUMA is enabled:

      The cpu_to_node() is called before it is initialized.

  So all the four places are set with the wrong node id (get by 
cpu_to_node()):

            a.) early_trace_init()         in kernel/trace/trace.c
	   b.) sched_init()               in kernel/sched/core.c
	   c.) init_sched_fair_class()    in kernel/sched/fair.c
	   d.) workqueue_init_early()     in kernel/workqueue.c


Thanks

Huang Shijie




More information about the linux-arm-kernel mailing list