linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch_topology: Do not set llc_sibling if llc_id is invalid
@ 2022-04-11  2:36 Qing Wang
  2022-04-11  8:37 ` Sudeep Holla
  2022-04-11 15:07 ` Andy Shevchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Qing Wang @ 2022-04-11  2:36 UTC (permalink / raw)
  To: Sudeep Holla, Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel
  Cc: Wang Qing

From: Wang Qing <wangqing@vivo.com>

When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which
will set llc_sibling 0xff(...), this is misleading.

Don't set llc_sibling(default 0) if we don't know the cache topology.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/base/arch_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 1d6636e..5c3a642
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -684,7 +684,7 @@ void update_siblings_masks(unsigned int cpuid)
 	for_each_online_cpu(cpu) {
 		cpu_topo = &cpu_topology[cpu];
 
-		if (cpuid_topo->llc_id == cpu_topo->llc_id) {
+		if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) {
 			cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling);
 			cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling);
 		}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] arch_topology: Do not set llc_sibling if llc_id is invalid
@ 2022-03-28  7:24 Qing Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Qing Wang @ 2022-03-28  7:24 UTC (permalink / raw)
  To: Sudeep Holla, Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel
  Cc: Wang Qing

From: Wang Qing <wangqing@vivo.com>

When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which
will set llc_sibling 0xff(...), this is misleading.

Don't set llc_sibling(default 0) if we don't know the cache topology.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/base/arch_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 1d6636e..5c3a642
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -684,7 +684,7 @@ void update_siblings_masks(unsigned int cpuid)
 	for_each_online_cpu(cpu) {
 		cpu_topo = &cpu_topology[cpu];
 
-		if (cpuid_topo->llc_id == cpu_topo->llc_id) {
+		if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) {
 			cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling);
 			cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling);
 		}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-12 10:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11  2:36 [PATCH] arch_topology: Do not set llc_sibling if llc_id is invalid Qing Wang
2022-04-11  8:37 ` Sudeep Holla
2022-04-11  9:32   ` Greg Kroah-Hartman
2022-04-11 15:07 ` Andy Shevchenko
2022-04-12  8:58   ` Sudeep Holla
  -- strict thread matches above, loose matches on Subject: below --
2022-03-28  7:24 Qing Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).