All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qing Wang <wangqing@vivo.com>
To: Sudeep Holla <sudeep.holla@arm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org
Cc: Wang Qing <wangqing@vivo.com>
Subject: [PATCH] arch_topology: Do not set llc_sibling if llc_id is invalid
Date: Sun, 10 Apr 2022 19:36:19 -0700	[thread overview]
Message-ID: <1649644580-54626-1-git-send-email-wangqing@vivo.com> (raw)

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


             reply	other threads:[~2022-04-11  2:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11  2:36 Qing Wang [this message]
2022-04-11  8:37 ` [PATCH] arch_topology: Do not set llc_sibling if llc_id is invalid 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1649644580-54626-1-git-send-email-wangqing@vivo.com \
    --to=wangqing@vivo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.