Re: [RFC PATCH v5 1/4] topology: Represent clusters of CPUs within a die

From: Greg KH
Date: Fri Mar 19 2021 - 02:36:14 EST


On Fri, Mar 19, 2021 at 05:16:15PM +1300, Barry Song wrote:
> diff --git a/Documentation/admin-guide/cputopology.rst b/Documentation/admin-guide/cputopology.rst
> index b90dafc..f9d3745 100644
> --- a/Documentation/admin-guide/cputopology.rst
> +++ b/Documentation/admin-guide/cputopology.rst
> @@ -24,6 +24,12 @@ core_id:
> identifier (rather than the kernel's). The actual value is
> architecture and platform dependent.
>
> +cluster_id:
> +
> + the Cluster ID of cpuX. Typically it is the hardware platform's
> + identifier (rather than the kernel's). The actual value is
> + architecture and platform dependent.
> +
> book_id:
>
> the book ID of cpuX. Typically it is the hardware platform's
> @@ -56,6 +62,14 @@ package_cpus_list:
> human-readable list of CPUs sharing the same physical_package_id.
> (deprecated name: "core_siblings_list")
>
> +cluster_cpus:
> +
> + internal kernel map of CPUs within the same cluster.
> +
> +cluster_cpus_list:
> +
> + human-readable list of CPUs within the same cluster.
> +
> die_cpus:
>
> internal kernel map of CPUs within the same die.

Why are these sysfs files in this file, and not in a Documentation/ABI/
file which can be correctly parsed and shown to userspace?

Any chance you can fix that up here as well?

Also note that "list" is not something that goes in sysfs, sysfs is "one
value per file", and a list is not "one value". How do you prevent
overflowing the buffer of the sysfs file if you have a "list"?

thanks,

greg k-h