Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2974397iog; Mon, 27 Jun 2022 06:47:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sq/VINwlwNJq2+dHa8ytWtbHoPHWtnByNyvHF81L+anlaGMaThJkqv75iJ+LIPVwOKS/+r X-Received: by 2002:a17:90b:357:b0:1ee:e31f:7512 with SMTP id fh23-20020a17090b035700b001eee31f7512mr4495895pjb.8.1656337661876; Mon, 27 Jun 2022 06:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656337661; cv=none; d=google.com; s=arc-20160816; b=pF2Bo6fZOtjuAQOvunzNeAseQSAPEqof+DTybRL832AijEifK51BMXVh0sjo+KJgY9 fcm/vYvg+cUl/UN26vbf+E5gD6/bltoz/fh+B+1kdPwiFIR41kCzjETdj9yuz97Wg4FX VllonUL/l9Pg+O/Ig3k/6riUCS1sxiMXNyy1v3lWowIStlm42jc80A6poV+lgdmnRwZv 1pJQ1cLKY6Mc+uwKiRrlXkDNMjMOqe4ldebiKtXWfc4E+vX7jpJpoq0F/FOjxuB7UBer hY6IXouSUJPGMVskuZHknhL+XSryWt+3yn3WPBtzoCb77VJ0YiKGDprVMGvlp/DbiaVo K2jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=tBnI2YkdlJWgs50gJ8hGBmcai1E3uZLIm+KWpbOogwA=; b=NjaSq7eayFmRzyvZvjD59PoFtzADit7KUBGDLtSEyG2LULBzIIp7k2dYFOO/yidnQG kH3bklPv0AOh7SCApNE6d3WhKaq0ITVCxITSCUzbp/ClP94r/SB4FJaTMNM+grl6TV4T uDSUSBNJ9MXXRC4ZhPJjikfHEBxRQD30w//lgc4TRk33GXtIAKu+jwRNNXZY484rW0oS TdSu3GPQZBRhRmvbHb2RuX9i/B7BwbCmFWS3peWGAVsP3GXD0+XreNI7+wGN+AozhZfX SQ9J78arkmLlEvsQAafXFAbMWhveDsZS4Xuqj4hQHpOmz+8L0KImUJpKO1nf9v6HvfSk JISw== 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:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a170902daca00b00168bedf2b1bsi18243123plx.598.2022.06.27.06.47.29; Mon, 27 Jun 2022 06:47:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236209AbiF0Nmq (ORCPT + 99 others); Mon, 27 Jun 2022 09:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234459AbiF0Nmo (ORCPT ); Mon, 27 Jun 2022 09:42:44 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B3FB02DCD for ; Mon, 27 Jun 2022 06:42:43 -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 B7E7A1758; Mon, 27 Jun 2022 06:42:43 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.1.196.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29DB43F5A1; Mon, 27 Jun 2022 06:42:43 -0700 (PDT) Date: Mon, 27 Jun 2022 14:42:41 +0100 From: Ionela Voinescu To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, Greg KH , Atish Patra , Atish Patra , Vincent Guittot , Dietmar Eggemann , Qing Wang , Rob Herring , "Rafael J . Wysocki" , Pierre Gondois , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Gavin Shan Subject: Re: [PATCH v4 12/20] arch_topology: Set thread sibling cpumask only within the cluster Message-ID: References: <20220621192034.3332546-1-sudeep.holla@arm.com> <20220621192034.3332546-13-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220621192034.3332546-13-sudeep.holla@arm.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Tuesday 21 Jun 2022 at 20:20:26 (+0100), Sudeep Holla wrote: > 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 ^^^^ Nit: may > siblings wrongs as the core identifiers can be same for 2 different CPUs Nit: ^^^^^^ wrong Thanks, Ionela. > 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. > > Reviewed-by: Gavin Shan > Tested-by: Gavin Shan > 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 b63cc52e12ce..7a5ff1ea5f00 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -708,15 +708,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 >