[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Za4cNBQBLZujlAlP@kernel.org>
Date: Mon, 22 Jan 2024 09:41:40 +0200
From: Mike Rapoport <rppt@...nel.org>
To: Shijie Huang <shijie@...eremail.onmicrosoft.com>
Cc: Yury Norov <yury.norov@...il.com>,
Huang Shijie <shijie@...amperecomputing.com>,
gregkh@...uxfoundation.org, patches@...erecomputing.com,
rafael@...nel.org, paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, kuba@...nel.org, vschneid@...hat.com,
mingo@...nel.org, akpm@...ux-foundation.org, vbabka@...e.cz,
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] NUMA: Early use of cpu_to_node() returns 0 instead of
the correct node id
On Fri, Jan 19, 2024 at 04:50:53PM +0800, Shijie Huang wrote:
>
> 在 2024/1/19 16:42, Mike Rapoport 写道:
> > Is there a fundamental reason to have early_cpu_to_node() at all?
>
> The early_cpu_to_node does not work on some ARCHs (which support the NUMA),
> such as SPARC, MIPS and S390.
My question was why we need early_cpu_to_node() at all and why can't we use
cpu_to_node() early on arches that do have it.
> Thanks
>
> Huang Shijie
>
> > It seems that all the mappings are known by the end of setup_arch() and the
> > initialization of numa_node can be moved earlier.
> > > > I would also initialize the numa_node with NUMA_NO_NODE at declaration,
> > > > so that if someone calls cpu_to_node() before the variable is properly
> > > > initialized at runtime, he'll get NO_NODE, which is obviously an error.
> > > Even we set the numa_node with NUMA_NO_NODE, it does not always produce
> > > error.
> > >
> > > Please see the alloc_pages_node().
> > >
> > >
> > > Thanks
> > >
> > > Huang Shijie
> > >
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists