Re: [RFC PATCH v2 08/35] x86/topology: Switch over to GENERIC_CPU_DEVICES

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 Sep 2023 16:37:56 +0000
James Morse <james.morse@xxxxxxx> wrote:

> Now that GENERIC_CPU_DEVICES calls arch_register_cpu(), which can be
> overridden by the arch code, switch over to this to allow common code
> to choose when the register_cpu() call is made.
> 
> x86's struct cpus come from struct x86_cpu, which has no other members
> or users. Remove this and use the version defined by common code.
> 
> This is an intermediate step to the logic being moved to drivers/acpi,
> where GENERIC_CPU_DEVICES will do the work when booting with acpi=off.
> 
> Signed-off-by: James Morse <james.morse@xxxxxxx>
> ----
> Changes since RFC:
>  * Fixed the second copy of arch_register_cpu() used for non-hotplug

Hi James,

See below for comment on this.  Upshot - I think you can delete that
function instead and rely on the weak version.

If you can't because of a later change, useful to call that out
in this patch description for those like me who read an review
in a linear fashion!

...

>  EXPORT_SYMBOL(arch_unregister_cpu);
>  #else /* CONFIG_HOTPLUG_CPU */
>  
> -int __init arch_register_cpu(int num)
> +int arch_register_cpu(int num)
>  {
> -	return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
> +	return register_cpu(&per_cpu(cpu_devices, num), num);
>  }

Looks like the weak version introduced in patch 3.  Can this
implementation go away and fallback to that?

>  #endif /* CONFIG_HOTPLUG_CPU */
> -
> -static int __init topology_init(void)
> -{
> -	int i;
> -
> -	for_each_present_cpu(i)
> -		arch_register_cpu(i);
> -
> -	return 0;
> -}
> -subsys_initcall(topology_init);




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux