Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp753395iob; Fri, 13 May 2022 11:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmQwCyAJWO+m3KlO+ivEbmF/oGQaORqccRdBk9EhlgrstauwQ4ibIPxmICJCMXpEDmyj7u X-Received: by 2002:adf:e0c5:0:b0:206:1ba3:26aa with SMTP id m5-20020adfe0c5000000b002061ba326aamr5077219wri.645.1652467448083; Fri, 13 May 2022 11:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652467448; cv=none; d=google.com; s=arc-20160816; b=nq4MYnRlkCEYPkMWhRPLzn9kH7f0LMnA4GnSU6JbqvU1hyc6+/sprFLOiSQyq6sbQ3 Ka9qFieOU82d/nJhdGXlxjC65R+Tmm9nE2n+SOQTZJer/VsrWGWzMD3jbF2V2ATxS6i4 17SJnRA/OhYKjMoEuNu/3kjJ+v2cidfjyJeaJef5RmSUt4hbeOhiRAGQecR+yvq3DTMQ jHbe1RA3uQ4xaTArewANeuIjDx49bMj3URCbSP+jSpLvNInlCDF3qdtH+LmJgGO+5CpT sUAzKRzX/B4ZyibfdKyiaXj7gPafCEKm9YxYuobRqrGpfhhm6NFw+aK5Hx80EjUN1QjG k+MA== 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=hcuTvVQLdiEhq3IUQStsEaX0DyqBZ1Ri8kelM0UcjB0=; b=dbx6AQtYQ7ie3lEy+uzaqiy/jIgYCb9FFUYXw8qG1cT09RSe76CUuFol3w4kyJiO7h i1vu01APnEWHLxt6dnP76dkh4UOCkZxsZl7jo165d79gWv4o/aJffx4m4N+PUqwqPKWV q4okQwBYzXObLomFuhyV1fTCniAOClcudXbVQRw6F2Ws4BjquNCODGoH+WxtXQ4IzOqi 4rIJnOyqVK2s9jJnrRvXssf43kIZ8rBh/zglY0FD7JgkCGAT1tcZKIWHD4h1WJQJNgKc OtK0W+plWgKQIw1by3q1pMCrdjfmVLmCdfBRV/s+85/imAH+PizhYwcs9I7eNxZIt95X c6MQ== 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 i10-20020adffdca000000b0020ac2429c84si2470547wrs.971.2022.05.13.11.43.34; Fri, 13 May 2022 11:44:08 -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 S1378933AbiEMJEP (ORCPT + 99 others); Fri, 13 May 2022 05:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378953AbiEMJD7 (ORCPT ); Fri, 13 May 2022 05:03:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C35062B3F53 for ; Fri, 13 May 2022 02:03:38 -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 C5899113E; Fri, 13 May 2022 02:03:38 -0700 (PDT) Received: from bogus (unknown [10.57.65.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3FFA3F73D; Fri, 13 May 2022 02:03:36 -0700 (PDT) Date: Fri, 13 May 2022 10:03:30 +0100 From: Sudeep Holla To: Dietmar Eggemann Cc: Qing Wang , Greg Kroah-Hartman , Sudeep Holla , "Rafael J . Wysocki" , Vincent Guittot , Morten Rasmussen , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] arch_topology: Use llc_id instead of package_id Message-ID: <20220513090330.z25fwthekn4rjkwq@bogus> References: <20220513083400.343706-1-dietmar.eggemann@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220513083400.343706-1-dietmar.eggemann@arm.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 Fri, May 13, 2022 at 10:34:00AM +0200, Dietmar Eggemann wrote: > package_id should represent socket in DT. Free it for possible socket > dts parsing and use the so far unused llc_id / llc_sibling cpumask to > decode 1. level clusters used in pre-DynamIQ big/little systems. > > cpu_coregroup_mask() will return llc_sibling isntead of core_mask in > this case. > > This will let the cluster_id / cluster_sibling cpumask be available for > 2. level clusters (e.g. to map L2 sharing in Armv9 A510 complexes). > > The corresponding sched domain CLS is similarly used in ACPI (servers) > to map e.g. Kunpeng920 L3-tags or Ampere Altra's SCU bounderies. > > Lighlty tested on qemu-system-aarch64 with 1x8 (cluster-x-core) and > 2x4 cpu-map. > > Signed-off-by: Dietmar Eggemann > --- > > Related to: https://lkml.kernel.org/r/1652361692-13196-1-git-send-email-wangqing@vivo.com > > drivers/base/arch_topology.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index f73b836047cf..ac1488990cc8 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -490,7 +490,7 @@ static int __init get_cpu_for_node(struct device_node *node) > return cpu; > } > > -static int __init parse_core(struct device_node *core, int package_id, > +static int __init parse_core(struct device_node *core, int llc_id, > int core_id) > { > char name[20]; > @@ -506,7 +506,8 @@ static int __init parse_core(struct device_node *core, int package_id, > leaf = false; > cpu = get_cpu_for_node(t); > if (cpu >= 0) { > - cpu_topology[cpu].package_id = package_id; > + cpu_topology[cpu].package_id = 0; > + cpu_topology[cpu].llc_id = llc_id; > cpu_topology[cpu].core_id = core_id; > cpu_topology[cpu].thread_id = i; > } else if (cpu != -ENODEV) { > @@ -527,7 +528,8 @@ static int __init parse_core(struct device_node *core, int package_id, > return -EINVAL; > } > > - cpu_topology[cpu].package_id = package_id; > + cpu_topology[cpu].package_id = 0; While the above looks good and matches with what I am attempting to do as well ... > + cpu_topology[cpu].llc_id = llc_id; This looks wrong for simple reason that this is derived incorrectly from the cpu-map while there is no guarantee that it matches the last level cache ID on the system as we didn't parse the cache topology for this. So I disagree with this change as it might conflict with the actual and correct llc_id. -- Regards, Sudeep