Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5738870ioo; Wed, 1 Jun 2022 11:29:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHpoFEQVgcQmTkfXQDFDpLy/iTj9Aj4Z73Du6XqLvaIHhRGc2U55++3A/olZwoa6+XBT8i X-Received: by 2002:a17:902:dac9:b0:164:9cfa:ce99 with SMTP id q9-20020a170902dac900b001649cface99mr727608plx.55.1654108179956; Wed, 01 Jun 2022 11:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654108179; cv=none; d=google.com; s=arc-20160816; b=azyb/blZEbnbzwBnqAWgs9BblOQoT3lrrIgToLkr2sjcgY0FsTlrmpALOP+P1j2r/F WOHK4ITwcu46Vgefdc4rT+7mOAc5Nnx5UyKmOyNEgfgbQLoPaOjS6DK0Psdw2Qu1QO1W 80QVDw4S9vD3qkGMLmJWyep/ZcvXXOiVUPSIwLAmOcbao0WlNU4mTktRBCfz63Mt/Q4q Z+Y1dV/dihsYjeE1cU8KcRm00K0UXtyiJG8/6Uf31nOw/+fWFu2GKttwmIlGGs7U2lza +N+Ov9XZlH2HleACi7iUqQXg0LS8fJW7jnSOpsPgCvw4dnio6/BP+U2v8WSk9diutb3h O4xw== 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=kFnZIZTCkehypn5WjpiRH1ndutxaCmXxpws7LN8oRps=; b=r3nNGLECmx7wXPgGkrw8lcVgZ0LFh66rMLpApuN1hFCElRik4MnLLUludEPynwrpK5 DWRG3E5xWkCufd6WNKLpPnYjctapB9fFLwwcLBQAJG9/Z9luSozJvKQME0M6nNIGmz/N drYYwgwNcUgLg3j918fQajm0mPOwC9bRAqFesyEk5Jew2SgTmM6nzzUnAAyUU2YN2hy3 ni2CqOKt9jbGUo6O/00ABCDQ814VzKv55t3JsS8mikg24YbAj7PIX00pREiDj3miGwER fGHKIUbNyNiPCE4Qy37FoDyik+yq2RVPJqDV5Hf0pRklakNQUqc+sTqhufzXFDqxY87S cbaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZSD3UqMr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id p5-20020a634205000000b003abadb1ec48si2840585pga.210.2022.06.01.11.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:29:39 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZSD3UqMr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 C4F1D6BFEA; Wed, 1 Jun 2022 11:28:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349407AbiFADcP (ORCPT + 99 others); Tue, 31 May 2022 23:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349442AbiFADcN (ORCPT ); Tue, 31 May 2022 23:32:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0834625C45 for ; Tue, 31 May 2022 20:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654054330; 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=kFnZIZTCkehypn5WjpiRH1ndutxaCmXxpws7LN8oRps=; b=ZSD3UqMrXyHNg979JFB+6EYus2CIPzgzgZMru9K++7otKYSTiWNmhy+avPAzAriIaQVeUD Q3uMolGpLT1Zb/FIGQDCKCSLiXHcE9k5NBq2eZWQSw0Z7+xgNm1VJUWPutVS8I9ArxrM5c qEEEyvHQyKspYnBwaVJUMHg/5qCmaUo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-94-OCLPGme_PkSjycFeBZ5Y3w-1; Tue, 31 May 2022 23:32:00 -0400 X-MC-Unique: OCLPGme_PkSjycFeBZ5Y3w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3D5880029D; Wed, 1 Jun 2022 03:31:59 +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 202C940E80E1; Wed, 1 Jun 2022 03:31:53 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v3 07/16] arch_topology: Use the last level cache information from the cacheinfo 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> From: Gavin Shan Message-ID: <7e77071b-ba1f-20f4-91b8-aa0b95e92967@redhat.com> Date: Wed, 1 Jun 2022 11:31:50 +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-8-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.84 on 10.11.54.2 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: > The cacheinfo is now initialised early along with the CPU topology > initialisation. Instead of relying on the LLC ID information parsed > separately only with ACPI PPTT elsewhere, migrate to use the similar > information from the cacheinfo. > > This is generic for both DT and ACPI systems. The ACPI LLC ID information > parsed separately can now be removed from arch specific code. > > Signed-off-by: Sudeep Holla > --- > drivers/base/arch_topology.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > Reviewed-by: Gavin Shan > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 765723448b10..4c486e4e6f2f 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -663,7 +663,8 @@ const struct cpumask *cpu_coregroup_mask(int cpu) > /* not numa in package, lets use the package siblings */ > core_mask = &cpu_topology[cpu].core_sibling; > } > - if (cpu_topology[cpu].llc_id != -1) { > + > + if (last_level_cache_is_valid(cpu)) { > if (cpumask_subset(&cpu_topology[cpu].llc_sibling, core_mask)) > core_mask = &cpu_topology[cpu].llc_sibling; > } > @@ -694,7 +695,7 @@ void update_siblings_masks(unsigned int cpuid) > for_each_online_cpu(cpu) { > cpu_topo = &cpu_topology[cpu]; > > - if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) { > + if (last_level_cache_is_shared(cpu, cpuid)) { > cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); > cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); > } >