From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0C81C433EF for ; Wed, 6 Oct 2021 13:50:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8618D60F35 for ; Wed, 6 Oct 2021 13:50:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237861AbhJFNwK (ORCPT ); Wed, 6 Oct 2021 09:52:10 -0400 Received: from foss.arm.com ([217.140.110.172]:51672 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbhJFNwH (ORCPT ); Wed, 6 Oct 2021 09:52:07 -0400 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 4FE691FB; Wed, 6 Oct 2021 06:50:14 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 39F0B3F66F; Wed, 6 Oct 2021 06:50:10 -0700 (PDT) From: Valentin Schneider To: Barry Song <21cnbao@gmail.com> Cc: Dietmar Eggemann , LKML , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Aubrey Li , Borislav Petkov , Daniel Bristot de Oliveira , Ben Segall , Catalin Marinas , Greg Kroah-Hartman , Guodong Xu , "H. Peter Anvin" , Jonathan Cameron , Juri Lelli , "Cc\: Len Brown" , ACPI Devel Maling List , LAK , Linuxarm , Mark Rutland , Mel Gorman , msys.mizuma@gmail.com, "Zengtao \(B\)" , "Rafael J. Wysocki" , Steven Rostedt , Barry Song , Sudeep Holla , Thomas Gleixner , "Rafael J. Wysocki" , Tim Chen , Will Deacon , x86 , yangyicong , Tian Tao Subject: Re: [PATCH RESEND 1/3] topology: Represent clusters of CPUs within a die In-Reply-To: References: <20210924085104.44806-1-21cnbao@gmail.com> <20210924085104.44806-2-21cnbao@gmail.com> <87o883l9c8.mognet@arm.com> Date: Wed, 06 Oct 2021 14:49:49 +0100 Message-ID: <87lf36l0ua.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On 06/10/21 09:43, Barry Song wrote: > > Hi Valentin, > Yep, this is a very good question. I'd like change the code to: > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 7cb31d959f33..fc0836f460fb 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -622,7 +622,8 @@ 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) { > + if (cpuid_topo->cluster_id == cpu_topo->cluster_id && > + cpuid_topo->cluster_id != -1) { > cpumask_set_cpu(cpu, &cpuid_topo->cluster_sibling); > cpumask_set_cpu(cpuid, &cpu_topo->cluster_sibling); > } > > This should be consistent with Tim's patch3/3 for x86 in case > id is BAD_APICID: > static bool match_l2c(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) > { > ... > /* Do not match if we do not have a valid APICID for cpu: */ > if (per_cpu(cpu_l2c_id, cpu1) == BAD_APICID) > return false; > ... > } > LGTM.