Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5782184ioo; Wed, 1 Jun 2022 12:29:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhkbSYlR4WfYMiubGc5QKzPW+i7n3JgsQNLp8jVY2UgKWwn+AMm6+QU/k3gaSd00M+mpz9 X-Received: by 2002:a05:6a00:16cd:b0:51b:5f55:9bd with SMTP id l13-20020a056a0016cd00b0051b5f5509bdmr12717103pfc.6.1654111742509; Wed, 01 Jun 2022 12:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654111742; cv=none; d=google.com; s=arc-20160816; b=TOZRDq2XLqamzEQHf6GxU6pY/W2cuDEu2WUB4kNcrRSBMT+Yks5vopc7ynraiUSiAL mAPZRENGnNgkSjNl9k0gCWoPB/aRB1teUihwITiFsMAblhvLq8U17PxhNRGBe1EgQa6M UaqnlHZ++ckCO8aIyABYnOKUqUBs/f9tzLG31I0xlMcUpVEB0l2vuLRPMzHmUQUzueCd 1vr2vqLJNHYjQd5eB1dd0F7soTdFvLBqEpq8/yLiMN2O3E162CxPkkxIx21M+xb5VqCq hBCeoofuwgnFDxPije2Q7JUCysGAyMMRz4ZXs9cqVDVLuoXlWO1cNrNqw3lIRcdVeesa MUkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to:dkim-signature; bh=diXfH14fQbDhfoWdKmQOqCsBx1nPcLvkXuJMvjSWG+c=; b=lyGkrZ80U7BlOTPuruyZeQNrC5GckqfRYljgDyzb5nKelJH6ollfraqDc1+PV338qM exHIAy8NuyZSSB0uKg5rmFGPcGPyk1yVdoLIuHvgY3ESVp3c+MNyvzhLywZ9gqbNF9fC ptMTsCivtXLSzUkA6/RsD40OV7hvln6pdVgSWl43tYOZhD03/DeNsmIDOka7YSstUrw1 GrSsa7JfcESqRsMweQMOe562KHtt8yNZnf2PlRxD7rcl0QHJH1wWkSWRWsL3N8wcEN1D bEAciOFM5jhv87PSD1fywzvsBYva9lGIoMS3Sf2Sf8D38PsaPAOGZWqTrJIQG8fBpUEL 9ScA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GV07hMvr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 75-20020a63024e000000b003fcae4bed03si2712217pgc.743.2022.06.01.12.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:29:02 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GV07hMvr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C4A117EF7D; Wed, 1 Jun 2022 12:01:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236867AbiFADhG (ORCPT + 99 others); Tue, 31 May 2022 23:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbiFADhD (ORCPT ); Tue, 31 May 2022 23:37:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E73044BFE3 for ; Tue, 31 May 2022 20:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654054621; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=diXfH14fQbDhfoWdKmQOqCsBx1nPcLvkXuJMvjSWG+c=; b=GV07hMvrNZBoO3SV7nB4o9PsuhupnlQJmAsD+up9iEKEuSFLzqruSk0ntYQEdaLSwJzdXW O0yK/yxVp6Pn7feEqJwkN3sxnbk4UIPNQQit8ZVusJZ/OCm8Y2rUJWu5W8AxMfPCvaYn+u lrfev7ajVEkWr2KFFRGx9ogaM35snEg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-Zr9aHkJcNhGBXJ_V-BDaRA-1; Tue, 31 May 2022 23:36:55 -0400 X-MC-Unique: Zr9aHkJcNhGBXJ_V-BDaRA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BDDB1C08989; Wed, 1 Jun 2022 03:36:55 +0000 (UTC) Received: from [10.72.12.91] (ovpn-12-91.pek2.redhat.com [10.72.12.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDBD61410F36; Wed, 1 Jun 2022 03:36:49 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v3 10/16] arch_topology: Set thread sibling cpumask only within the cluster To: Sudeep Holla , linux-kernel@vger.kernel.org Cc: Atish Patra , Atish Patra , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Qing Wang , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Rob Herring References: <20220525081416.3306043-1-sudeep.holla@arm.com> <20220525081416.3306043-2-sudeep.holla@arm.com> <20220525081416.3306043-3-sudeep.holla@arm.com> <20220525081416.3306043-4-sudeep.holla@arm.com> <20220525081416.3306043-5-sudeep.holla@arm.com> <20220525081416.3306043-6-sudeep.holla@arm.com> <20220525081416.3306043-7-sudeep.holla@arm.com> <20220525081416.3306043-8-sudeep.holla@arm.com> <20220525081416.3306043-9-sudeep.holla@arm.com> <20220525081416.3306043-10-sudeep.holla@arm.com> <20220525081416.3306043-11-sudeep.holla@arm.com> From: Gavin Shan Message-ID: <1a35c21c-25cf-46ef-6400-152db421de52@redhat.com> Date: Wed, 1 Jun 2022 11:36:44 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20220525081416.3306043-11-sudeep.holla@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 5/25/22 4:14 PM, 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 > 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(-) > Reviewed-by: Gavin Shan Tested-by: Gavin Shan > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 76c702c217c5..59dc2c80c439 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -703,15 +703,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; > >