[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3817e18-e2ae-4ac2-b2b1-f68cf10ff418@amperemail.onmicrosoft.com>
Date: Thu, 28 Mar 2024 10:09:02 +0800
From: Shijie Huang <shijie@...eremail.onmicrosoft.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Huang Shijie <shijie@...amperecomputing.com>
Cc: gregkh@...uxfoundation.org, patches@...erecomputing.com,
rafael@...nel.org, paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, yury.norov@...il.com, kuba@...nel.org,
vschneid@...hat.com, mingo@...nel.org, vbabka@...e.cz, rppt@...nel.org,
tglx@...utronix.de, jpoimboe@...nel.org, ndesaulniers@...gle.com,
mikelley@...rosoft.com, mhiramat@...nel.org, arnd@...db.de,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, catalin.marinas@....com,
will@...nel.org, mark.rutland@....com, mpe@...erman.id.au,
linuxppc-dev@...ts.ozlabs.org, chenhuacai@...nel.org,
jiaxun.yang@...goat.com, linux-mips@...r.kernel.org,
cl@...amperecomputing.com
Subject: Re: [PATCH v3] NUMA: Early use of cpu_to_node() returns 0 instead of
the correct node id
在 2024/3/28 2:17, Andrew Morton 写道:
> On Fri, 26 Jan 2024 14:44:51 +0800 Huang Shijie <shijie@...amperecomputing.com> wrote:
>
>> 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.
> What are the userspace-visible runtime effects of this bug?
>
For this bug, I do not see too much performance impact in the userspace
applications.
It just pollutes the CPU caches in NUMA.
Thanks
Huang Shijie
Powered by blists - more mailing lists