Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1000697iob; Fri, 13 May 2022 19:11:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyf2RaX/fFaSK8zKf3nkJw51PHHhswoJSLmbyNmrraCo0DE9Ja2w7gUjb+v3Dm3cY4Rr5K X-Received: by 2002:adf:e587:0:b0:20a:cfbb:ac08 with SMTP id l7-20020adfe587000000b0020acfbbac08mr5839144wrm.718.1652494260519; Fri, 13 May 2022 19:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652494260; cv=none; d=google.com; s=arc-20160816; b=g/qSJ6YWfpu+njwe0buTOVMIq9wmMpY7Nb9SKNIxpRzZeloy1Loc05AerTdHVa4Q58 bSzg10RGr0EOB0vVuXKOjd4R1M7g44I22VseKr+5xnsySteQUx9kZ/CgDr8eLUlZaECF 1/alN2rY2zmaiqwzz1UKv1jEhE/JOtGmi/mm6R1KF7/B+sCuw6TjG4eMbkmijeoMBdq0 MKaevFfCIqF0RKpYmh43nKu0P4X+ehUdfueRfGFLfqCXV/d/Quh8Q+15tW0cP9uXALhp 3viW+UaUamRm5xNs6VG26wLgc1ly6IqlsHSeDdgTriyYvXrwmM++fp3+pxVr28krGRPN lTWg== 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=V7QKSKUdTrD2BT0vv8YJ597ew8YTJ5fqPuFosz/Jd1A=; b=buFGwcjnghqgB0LgG1p/pCZgiUNYKPx13N29GXake+9Cy79Iuh+IQvDYt8TJ8LaYM/ NyOFycrmr/JglYmJYVaGX8yNPgOdqUnbkomLPoCe8+KH3o4ieeWVVtOoLNp9nRfVl9fa 7AKJnZafiaqxhckb0YwB/jBaOf+3rWddl/ZPlgAL85Ge7dHkUMu4PShn/i79K6JhHnSC UrTEw/NBStwe1SpE2KYg/bxPPKEuOgGYA8ROTG15p6y1cDQAyvwWkPuS6woP9LzVL+F0 K8iNXRyeDetJP24j3YwwpOvKe4XCqGT4z1XyDv0wrc0rVQdhVn6swO0/Emxk/FZ7zXKl ybWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p18-20020a5d68d2000000b0020c7e230c8esi3254150wrw.285.2022.05.13.19.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:11:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 7CC8A4986F2; Fri, 13 May 2022 17:29:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378821AbiEMJ41 (ORCPT + 99 others); Fri, 13 May 2022 05:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379223AbiEMJ4P (ORCPT ); Fri, 13 May 2022 05:56:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 608AE19029 for ; Fri, 13 May 2022 02:56:14 -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 369B31515; Fri, 13 May 2022 02:56:14 -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 EB67F3F5A1; Fri, 13 May 2022 02:56:12 -0700 (PDT) From: Sudeep Holla To: Atish Patra , Atish Patra , linux-kernel@vger.kernel.org Cc: Sudeep Holla , Atish Patra , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Qing Wang Subject: [PATCH 2/4] arch_topology: Set thread and core siblings only within the cluster Date: Fri, 13 May 2022 10:55:57 +0100 Message-Id: <20220513095559.1034633-3-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513095559.1034633-1-sudeep.holla@arm.com> References: <20220513095559.1034633-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 may result in getting the core siblings wrongs as the core identifiers can be same for 2 different CPUs belonging to 2 different cluster. So, in order to get the core and thread sibling masks correct, we need to update them only if they belong to same cluster within the socket. Let us skip updation of the thread and core sibling cpumaks if the socket and 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 44f733b365cc..5812428253d8 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -694,11 +694,11 @@ void update_siblings_masks(unsigned int cpuid) cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); } - if (cpuid_topo->package_id != cpu_topo->package_id) + if (cpuid_topo->package_id != cpu_topo->package_id || + cpuid_topo->cluster_id != cpu_topo->cluster_id) continue; - if (cpuid_topo->cluster_id == cpu_topo->cluster_id && - cpuid_topo->cluster_id != -1) { + if (cpuid_topo->cluster_id != -1) { cpumask_set_cpu(cpu, &cpuid_topo->cluster_sibling); cpumask_set_cpu(cpuid, &cpu_topo->cluster_sibling); } -- 2.36.1