]> git.baikalelectronics.ru Git - kernel.git/commit
topology/sysfs: export cluster attributes only if an architectures has support
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 29 Nov 2021 13:03:08 +0000 (14:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Dec 2021 14:58:27 +0000 (15:58 +0100)
commit58ab8a914e6f6d5d0263c9c4ee29edba5bd577c9
tree615a631ee947f202dc2f424688da428039469d63
parent3ff1db71c8f901fdf75f8aad7d5c11d4647f51d2
topology/sysfs: export cluster attributes only if an architectures has support

The cluster_id and cluster_cpus topology sysfs attributes have been
added with commit c72c071d2bc7 ("topology: Represent clusters of CPUs
within a die").

They are currently only used for x86, arm64, and riscv (via generic
arch topology), however they are still present with bogus default
values for all other architectures. Instead of enforcing such new
sysfs attributes to all architectures, make them only optional visible
if an architecture opts in by defining both the topology_cluster_id
and topology_cluster_cpumask attributes.

This is similar to what was done when the book and drawer topology
levels were introduced: avoid useless and therefore confusing sysfs
attributes for architectures which cannot make use of them.

This should not break any existing applications, since this is a
new interface introduced with the v5.16 merge window.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20211129130309.3256168-3-hca@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/admin-guide/cputopology.rst
drivers/base/topology.c
include/linux/topology.h