Re: [PATCH V2] irqchip/loongson-eiointc: Use early_cpu_to_node() instead of cpu_to_node()

From: Huacai Chen
Date: Sat Jun 22 2024 - 07:24:24 EST


Hi, Thomas,

On Sat, Jun 22, 2024 at 6:17 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> Huacai!
>
> On Sat, Jun 22 2024 at 10:49, Huacai Chen wrote:
> > On Sat, Jun 22, 2024 at 4:42 AM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> >>
> >> On Thu, Jun 20 2024 at 10:06, Huacai Chen wrote:
> >> > When we use "nr_cpus=n" to hard limit the CPU number, cpu_to_node() is
> >> > not usable because it can only applied on "possible" CPUs. On the other
> >> > hand, early_cpu_to_node() can be always used instead.
> > cpu_to_node() depends on per-cpu area, and per-cpu area is only usable
> > for "possible" CPUs.
>
> When nr_cpus=n is on the command line then what needs to access
> something for CPUs which are not possible to come ever online?
>
> That does not make sense because it's exactly the same situation when
> you compile a kernel with NR_CPU=8 and boot it on a system with 16
> CPUs. Then early_cpu_to_node() does not give you anything either.
>
> So what's the technical problem you are trying to solve?
Frankly, there are some drawbacks on our hardware. On a dual-bridge
machine, there are two eiointc instances. Even if nr_cpus limits the
"possible" CPUs, we still hope the eiointc driver can initialize
correctly, otherwise the machine cannot boot.

Huacai

>
> Thanks,
>
> tglx