Re: [PATCH RFC 01/22] arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
- Subject: Re: [PATCH RFC 01/22] arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs
- From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
- Date: Tue, 28 Nov 2023 14:37:22 +0000
- Cc: <linux-pm@xxxxxxxxxxxxxxx>, <loongarch@xxxxxxxxxxxxxxx>, <linux-acpi@xxxxxxxxxxxxxxx>, <linux-arch@xxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, <linux-riscv@xxxxxxxxxxxxxxxxxxx>, <kvmarm@xxxxxxxxxxxxxxx>, <x86@xxxxxxxxxx>, <linux-csky@xxxxxxxxxxxxxxx>, <linux-doc@xxxxxxxxxxxxxxx>, <linux-ia64@xxxxxxxxxxxxxxx>, <linux-parisc@xxxxxxxxxxxxxxx>, Salil Mehta <salil.mehta@xxxxxxxxxx>, Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>, <jianyong.wu@xxxxxxx>, <justin.he@xxxxxxx>, James Morse <james.morse@xxxxxxx>, Sudeep Holla <sudeep.holla@xxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
- In-reply-to: <E1r0JKl-00CTwT-Hx@rmk-PC.armlinux.org.uk>
- Organization: Huawei Technologies Research and Development (UK) Ltd.
- References: <ZUoRY33AAHMc5ThW@shell.armlinux.org.uk> <E1r0JKl-00CTwT-Hx@rmk-PC.armlinux.org.uk>
On Tue, 07 Nov 2023 10:29:23 +0000
Russell King <rmk+kernel@xxxxxxxxxxxxxxx> wrote:
> From: James Morse <james.morse@xxxxxxx>
>
> register_cpu_capacity_sysctl() adds a property to sysfs that describes
> the CPUs capacity. This is done from a subsys_initcall() that assumes
> all possible CPUs are registered.
>
> With CPU hotplug, possible CPUs aren't registered until they become
> present, (or for arm64 enabled). This leads to messages during boot:
> | register_cpu_capacity_sysctl: too early to get CPU1 device!
> and once these CPUs are added to the system, the file is missing.
>
> Move this to a cpuhp callback, so that the file is created once
> CPUs are brought online. This covers CPUs that are added late by
> mechanisms like hotplug.
> One observable difference is the file is now missing for offline CPUs.
>
> Signed-off-by: James Morse <james.morse@xxxxxxx>
> ---
> If the offline CPUs thing is a problem for the tools that consume
> this value, we'd need to move cpu_capacity to be part of cpu.c's
> common_cpu_attr_groups.
I'm not keen on squirting sysfs files in from code so
might be nice to do that anyway and use is_visible() / sysfs_update_group()
but that would be a job for another day if at all.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]