Re: [PATCH v2 04/11] arch_topology: Reset all cpus in reset_cpu_topology

From: Sudeep Holla
Date: Tue Apr 14 2020 - 06:03:46 EST


On Tue, Apr 14, 2020 at 04:35:14PM +0800, Jiaxun Yang wrote:
> On Tue, 14 Apr 2020 09:27:34 +0100
> Sudeep Holla <sudeep.holla@xxxxxxx> wrote:
>
> > On Sun, Apr 12, 2020 at 11:20:34AM +0800, Jiaxun Yang wrote:
> > > For MIPS platform, when topology isn't probed by DeviceTree,
> > > possible_cpu might be empty when calling init_cpu_topology,
> > > that may result cpu_topology not fully reseted for all CPUs.
> > > So here we can reset all cpus instead of possible cpus.
> > >
> >
> > As I have told before adjust and make it default before this function
> > gets called.
>
> Hi,
>
> That's really impossible under current MIPS code structure.
>

I really doubt that, but I have no knowledge on MIPS port, so I would
let maintainers take that call.

> Another option would be prefill possible_cpu with all_cpu_mask before
> calling topology_init, but that would make the code unnecessarily
> complex.
>

I still prefer that. By the time we call this function on a config
with say NR_CPUS=1024, we would have parsed DT and set nr_cpus to say 8
or 16 just for sake of example, so if platforms can't figure the
possible CPUs, let them set it to NR_CPUs so that not all platforms
have to run through that loop.

> Here simply reset the whole array won't cause any regression.
>

Not necessary, please discuss and check if some simplification to MIPS
can be done rather than patching here and there to make it work.

--
Regards,
Sudeep