drivers/base/arch_topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
The sibling information for one particular CPU is updated after ACPI
PPTT table is parsed. struct cpu_topology::thread_sibling tracks the
the CPUs in same core. However, cluster isn't considered when it's
populated. In this case, multiple threads belonging to different
clusters can be put together through the sibling information. It
eventually leads to unexpected warning from sched subsystem.
For example, the following warning is observed in a VM where we have
2 sockets, 4 clusters, 8 cores and 16 threads and the CPU topology
is populated as below.
CPU Socket-ID Cluster-ID Core-ID Thread-ID
----------------------------------------------
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
[ 0.592181] CPU: All CPU(s) started at EL1
[ 0.593766] alternatives: patching kernel code
[ 0.595890] BUG: arch topology borken
[ 0.597210] the SMT domain not a subset of the CLS domain
[ 0.599286] child=0-1,4-5 sd=0-3
# cat /sys/devices/system/cpu/cpu0/topology/cluster_cpus_list
0-3
# cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list
0-1,4-5
This fixes the issue by limiting threads to one specific cluster.
With this applied, the unexpected warning disappears in the VM.
# cat /sys/devices/system/cpu/cpu0/topology/cluster_cpus_list
0-3
# cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list
0-1
Signed-off-by: Gavin Shan <gshan@redhat.com>
---
drivers/base/arch_topology.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index f73b836047cf..25a63a89ae7d 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -710,7 +710,8 @@ void update_siblings_masks(unsigned int cpuid)
cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
- if (cpuid_topo->core_id != cpu_topo->core_id)
+ if (cpuid_topo->cluster_id != cpu_topo->cluster_id ||
+ cpuid_topo->core_id != cpu_topo->core_id)
continue;
cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling);
--
2.23.0
On Tue, May 24, 2022 at 04:12:12PM +0800, Gavin Shan wrote: > The sibling information for one particular CPU is updated after ACPI > PPTT table is parsed. struct cpu_topology::thread_sibling tracks the > the CPUs in same core. However, cluster isn't considered when it's > populated. In this case, multiple threads belonging to different > clusters can be put together through the sibling information. It > eventually leads to unexpected warning from sched subsystem. > > For example, the following warning is observed in a VM where we have > 2 sockets, 4 clusters, 8 cores and 16 threads and the CPU topology > is populated as below. > > CPU Socket-ID Cluster-ID Core-ID Thread-ID > ---------------------------------------------- > 0 0 0 0 0 > 1 0 0 0 1 > 2 0 0 1 0 > 3 0 0 1 1 > 4 0 1 0 0 > 5 0 1 0 1 > 6 0 1 1 0 > 7 0 1 1 1 > 8 1 0 0 0 > 9 1 0 0 1 > 10 1 0 1 0 > 11 1 0 1 1 > 12 1 1 0 0 > 13 1 1 0 1 > 14 1 1 1 0 > 15 1 1 1 1 > > [ 0.592181] CPU: All CPU(s) started at EL1 > [ 0.593766] alternatives: patching kernel code > [ 0.595890] BUG: arch topology borken > [ 0.597210] the SMT domain not a subset of the CLS domain > [ 0.599286] child=0-1,4-5 sd=0-3 > > # cat /sys/devices/system/cpu/cpu0/topology/cluster_cpus_list > 0-3 > # cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list > 0-1,4-5 > > This fixes the issue by limiting threads to one specific cluster. > With this applied, the unexpected warning disappears in the VM. > I have similar fix but as part of bigger series[1] to get DT support in line with ACPI. -- Regards, Sudeep [1] https://lore.kernel.org/lkml/20220518093325.2070336-3-sudeep.holla@arm.com
Hi Sudeep, On 5/24/22 4:51 PM, Sudeep Holla wrote: > On Tue, May 24, 2022 at 04:12:12PM +0800, Gavin Shan wrote: >> The sibling information for one particular CPU is updated after ACPI >> PPTT table is parsed. struct cpu_topology::thread_sibling tracks the >> the CPUs in same core. However, cluster isn't considered when it's >> populated. In this case, multiple threads belonging to different >> clusters can be put together through the sibling information. It >> eventually leads to unexpected warning from sched subsystem. >> >> For example, the following warning is observed in a VM where we have >> 2 sockets, 4 clusters, 8 cores and 16 threads and the CPU topology >> is populated as below. >> >> CPU Socket-ID Cluster-ID Core-ID Thread-ID >> ---------------------------------------------- >> 0 0 0 0 0 >> 1 0 0 0 1 >> 2 0 0 1 0 >> 3 0 0 1 1 >> 4 0 1 0 0 >> 5 0 1 0 1 >> 6 0 1 1 0 >> 7 0 1 1 1 >> 8 1 0 0 0 >> 9 1 0 0 1 >> 10 1 0 1 0 >> 11 1 0 1 1 >> 12 1 1 0 0 >> 13 1 1 0 1 >> 14 1 1 1 0 >> 15 1 1 1 1 >> >> [ 0.592181] CPU: All CPU(s) started at EL1 >> [ 0.593766] alternatives: patching kernel code >> [ 0.595890] BUG: arch topology borken >> [ 0.597210] the SMT domain not a subset of the CLS domain >> [ 0.599286] child=0-1,4-5 sd=0-3 >> >> # cat /sys/devices/system/cpu/cpu0/topology/cluster_cpus_list >> 0-3 >> # cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list >> 0-1,4-5 >> >> This fixes the issue by limiting threads to one specific cluster. >> With this applied, the unexpected warning disappears in the VM. >> > > I have similar fix but as part of bigger series[1] to get DT support in > line with ACPI. > Your patch resolves the issue I have. So please ignore mine. Sorry for the noise. https://lore.kernel.org/lkml/20220518093325.2070336-3-sudeep.holla@arm.com # cat /sys/devices/system/cpu/cpu0/topology/cluster_cpus_list 0-3 # cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list 0-1 Thanks, Gavin
On Tue, May 24, 2022 at 05:05:22PM +0800, Gavin Shan wrote: > Hi Sudeep, > > On 5/24/22 4:51 PM, Sudeep Holla wrote: > > On Tue, May 24, 2022 at 04:12:12PM +0800, Gavin Shan wrote: > > > The sibling information for one particular CPU is updated after ACPI > > > PPTT table is parsed. struct cpu_topology::thread_sibling tracks the > > > the CPUs in same core. However, cluster isn't considered when it's > > > populated. In this case, multiple threads belonging to different > > > clusters can be put together through the sibling information. It > > > eventually leads to unexpected warning from sched subsystem. > > > > > > For example, the following warning is observed in a VM where we have > > > 2 sockets, 4 clusters, 8 cores and 16 threads and the CPU topology > > > is populated as below. > > > > > > CPU Socket-ID Cluster-ID Core-ID Thread-ID > > > ---------------------------------------------- > > > 0 0 0 0 0 > > > 1 0 0 0 1 > > > 2 0 0 1 0 > > > 3 0 0 1 1 > > > 4 0 1 0 0 > > > 5 0 1 0 1 > > > 6 0 1 1 0 > > > 7 0 1 1 1 > > > 8 1 0 0 0 > > > 9 1 0 0 1 > > > 10 1 0 1 0 > > > 11 1 0 1 1 > > > 12 1 1 0 0 > > > 13 1 1 0 1 > > > 14 1 1 1 0 > > > 15 1 1 1 1 > > > > > > [ 0.592181] CPU: All CPU(s) started at EL1 > > > [ 0.593766] alternatives: patching kernel code > > > [ 0.595890] BUG: arch topology borken > > > [ 0.597210] the SMT domain not a subset of the CLS domain > > > [ 0.599286] child=0-1,4-5 sd=0-3 > > > > > > # cat /sys/devices/system/cpu/cpu0/topology/cluster_cpus_list > > > 0-3 > > > # cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list > > > 0-1,4-5 > > > > > > This fixes the issue by limiting threads to one specific cluster. > > > With this applied, the unexpected warning disappears in the VM. > > > > > > > I have similar fix but as part of bigger series[1] to get DT support in > > line with ACPI. > > > > Your patch resolves the issue I have. So please ignore mine. Sorry Thanks for that. > for the noise. > No worries, definitely not noise. -- Regards, Sudeep
© 2016 - 2026 Red Hat, Inc.