Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp311501iob; Wed, 18 May 2022 02:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyivLbqbDu1eOVkUrOJ/q26pbbK7e07RBrSp/3sq0wWTK4KvdwpWVZXs8lKAJw4PepusADC X-Received: by 2002:a17:90a:7441:b0:1df:5f54:502c with SMTP id o1-20020a17090a744100b001df5f54502cmr14552316pjk.129.1652867117425; Wed, 18 May 2022 02:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652867117; cv=none; d=google.com; s=arc-20160816; b=Qo03yUqyWuu+Xf17ZOaryiWytPD7ocDHf+piXNRldM42E3F12XNJguBMYTPY50ftS4 OtHAFiRAucKWlcZ5XDKuCVWsHJ2fq4AiqO4I+tLzgbFJfCMIRIUqg0/lW6Vjuf6+SFLZ L/xv5vVVIUwmNFkDaXGlFTcWrxGMy0N3VMDQjYPFkHDFkakUxTH+8EJP6tANIlJN6QSB 44c9HNX7Dmqf1hCIa579ULj2zAxeHIont8/6p0Zab5qJN2ZYicDBCfCrj1Fi7ukxN1sy Ipei5MVDjVbOG9g0VBLRNNnRK47xFIeDacHRoYp/59+uZxqviBYRou0VHg68R718mZPD C02Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xpvsU6UUmvBsceyswALZzazbzvfQ0U+KcO7LGh3IhQY=; b=sS501ELVSKtsQp7clPAeyw43VkTRWIrSLzHWniMIo+uAfBEghz9ncD/el0aVE/ac/k obY4eqFZC0SXUyKVUXvJ3KOKUj2P9KwgG81/So2rFVfDitZkx8yLrWM+132kMd0BTYd8 BOCKOW2mSzk08iolEnlvL5a8GqBAWOQoeeVzb38+iG/Q3eT7VekgfppApprrh582Bg+Z afaaOT/MK1mYYNUv5GPniQu3RcKmh85VZ+cDa0k9ZseweLTppe7YotOLC5qvIwKBJ/dd /Pb1buonKuYVU8rMbC+UhNptEoi/SzU/0YGFExP3yCTt5kPX+Q0nsmx2VekSo2taA1Y4 Qq/A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y6-20020a056a00190600b00505ad6b7610si2593253pfi.63.2022.05.18.02.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 02:45:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4373DB0D33; Wed, 18 May 2022 02:34:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234362AbiERJeD (ORCPT + 99 others); Wed, 18 May 2022 05:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbiERJeA (ORCPT ); Wed, 18 May 2022 05:34:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B17DBAFB2F for ; Wed, 18 May 2022 02:33:56 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 80B09106F; Wed, 18 May 2022 02:33:56 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 09EB73F66F; Wed, 18 May 2022 02:33:54 -0700 (PDT) From: Sudeep Holla To: Atish Patra , linux-kernel@vger.kernel.org Cc: Sudeep Holla , Atish Patra , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Qing Wang , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Rob Herring Subject: [PATCH v2 2/8] arch_topology: Set thread sibling cpumask only within the cluster Date: Wed, 18 May 2022 10:33:19 +0100 Message-Id: <20220518093325.2070336-3-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220518093325.2070336-1-sudeep.holla@arm.com> References: <20220518093325.2070336-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the cluster identifier is not set on the DT based platforms. The reset or default value is -1 for all the CPUs. Once we assign the cluster identifier values correctly that imay result in getting the thread siblings wrongs as the core identifiers can be same for 2 different CPUs belonging to 2 different cluster. So, in order to get the thread sibling cpumasks correct, we need to update them only if the cores they belong are in the same cluster within the socket. Let us skip updation of the thread sibling cpumaks if the cluster identifier doesn't match. This change won't affect even if the cluster identifiers are not set currently but will avoid any breakage once we set the same correctly. Signed-off-by: Sudeep Holla --- drivers/base/arch_topology.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 44f733b365cc..7f5aa655c1f4 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -697,15 +697,17 @@ void update_siblings_masks(unsigned int cpuid) if (cpuid_topo->package_id != cpu_topo->package_id) continue; - if (cpuid_topo->cluster_id == cpu_topo->cluster_id && - cpuid_topo->cluster_id != -1) { + cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); + cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); + + if (cpuid_topo->cluster_id != cpu_topo->cluster_id) + continue; + + if (cpuid_topo->cluster_id != -1) { cpumask_set_cpu(cpu, &cpuid_topo->cluster_sibling); cpumask_set_cpu(cpuid, &cpu_topo->cluster_sibling); } - 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) continue; -- 2.36.1