Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3490445pxp; Mon, 14 Mar 2022 22:19:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXgsDS3omXhsXKCRJgDXSSe32tu97ls6HGhYrA7AmmZgp4or10bWEPwQjuyWtGXZ5YlBmX X-Received: by 2002:a17:906:c10b:b0:6da:a190:edb0 with SMTP id do11-20020a170906c10b00b006daa190edb0mr20747128ejc.512.1647321587174; Mon, 14 Mar 2022 22:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647321587; cv=none; d=google.com; s=arc-20160816; b=bdXUPpH0l7LUt/bxHiRPzsF80STIw/Ojd0fX4ncGjse/J1adfpNP2wLJk7W/WUpUWl KltJr7vApalrAPB9mizokvpPGhknwXGgtyg4eGbwUhbW46mtwekENh6Qgp1fMrbm2pkR 9TyLgw791nh7p1IeBZhdO6GkUpRQAz6MoQgqHjWNkEntUydZhXmsS0M//revqM73AfIf 7EL2vsJP8KxXfX/Lj80aBvwSC7ZqLaYWzOgOnQyVShD1bwYVLQVEKVknv3eclhI78DBu I9lssryeB4vSoerMHbSS6dht8Ag0JH9qj7e1KydnZ5RmH+Kjs76E+Bo8tQ8dB+kLwZGx MFpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=160cIigrEMB6hbAVXUzKaRiKltJMhbyXZFBgtqCnX9E=; b=CU8xVabyiNUFPGhTtLpZ342ofeZaaWie/Xr9vj0nuaU3biUsHS/TXW4ebpGPYCYjzv WqIvSHb8DYfi64VtbF5pa/mqDHBt8NAzQNhRYwKH7+8rcYLS0lETq1ozlkROTCaiwY5j rIhwTNYeg+KUBDew2F0qpneONlTeYf7lyM2p+E2FPAT3yiiqfsT0flMnABb4IlLHiVpX dlhAJadmYVZCkpp5J910mWGcv7c/XPNuV5cS03F3416ZfbOInFqd1YvaUEnVfn1V7D8S ocT3qbHAMqBWLufKzEb320yQH7grY44lwtxNVDwIAVvCwW8wmFQpkTWrTb6GfLk8JVc6 5lUA== 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 dd15-20020a1709069b8f00b006da6458756dsi10892265ejc.567.2022.03.14.22.19.22; Mon, 14 Mar 2022 22:19:47 -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 S243553AbiCNSC2 (ORCPT + 99 others); Mon, 14 Mar 2022 14:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238681AbiCNSC1 (ORCPT ); Mon, 14 Mar 2022 14:02:27 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B65D3A1AB; Mon, 14 Mar 2022 11:01:16 -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 0F3141474; Mon, 14 Mar 2022 11:01:16 -0700 (PDT) Received: from [10.57.22.102] (unknown [10.57.22.102]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9982F3F66F; Mon, 14 Mar 2022 11:01:11 -0700 (PDT) Subject: Re: [PATCH v2 2/2] perf mem: Support HITM for when mem_lvl_num is used To: Leo Yan , Ali Saidi Cc: acme@kernel.org, alexander.shishkin@linux.intel.com, andrew.kilroy@arm.com, benh@kernel.crashing.org, james.clark@arm.com, john.garry@huawei.com, jolsa@kernel.org, kjain@linux.ibm.com, lihuafei1@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mark.rutland@arm.com, mathieu.poirier@linaro.org, mingo@redhat.com, namhyung@kernel.org, peterz@infradead.org, will@kernel.org, yao.jin@linux.intel.com, Nick.Forrington@arm.com References: <20220313124427.GB143848@leoy-ThinkPad-X240s> <20220313191933.26621-1-alisaidi@amazon.com> <20220314063353.GB163961@leoy-ThinkPad-X240s> From: German Gomez Message-ID: Date: Mon, 14 Mar 2022 18:00:13 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20220314063353.GB163961@leoy-ThinkPad-X240s> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Hi Leo, Ali On 14/03/2022 06:33, Leo Yan wrote: > On Sun, Mar 13, 2022 at 07:19:33PM +0000, Ali Saidi wrote: > > [...] > >>>>> + if (lvl & P(LVL, L3) || lnum == P(LVLNUM, L4)) { >>>> According to a comment in the previous patch, using L4 is specific to Neoverse, right? >>>> >>>> Maybe we need to distinguish the Neoverse case from the generic one here as well >>>> >>>> if (is_neoverse) >>>> // treat L4 as llc >>>> else >>>> // treat L3 as llc >>> I personally think it's not good idea to distinguish platforms in the decoding code. >> I agree here. The more we talk about this, the more I'm wondering if we're >> spending too much code solving a problem that doesn't exist. I know of no >> Neoverse systems that actually have 4 cache levels, they all actually have three >> even though it's technically possible to have four. I have some doubts anyone >> will actually build four levels of cache and perhaps the most prudent path here >> is to assume only three levels (and adjust the previous patch) until someone >> actually produces a system with four levels instead of a lot of code that is >> never actually exercised? > I am not right person to say L4 cache is not implemented in Neoverse > platforms; my guess for a "System cache" data source might be L3 or > L4 and it is a implementation dependent. Maybe German or Arm mates > could confirm for this. I had a look at the TRMs for the N1[1], V1[2] and N2[3] Neoverse cores (specifically the LL_CACHE_RD pmu events). If we were to assign a number to the system cache (assuming all caches are implemented): *For N1*, if L2 and L3 are implemented, system cache would follow at *L4* *For V1 and N2*, if L2 is implemented, system cache would follow at *L3* (these don't seem to have the same/similar per-cluster L3 cache from the N1) There's also room in the PERF_MEM_LVLNUM_* namespace for a SYSTEM value, if we want to consider that option as well. [1] https://developer.arm.com/documentation/100616/0401/?lang=en [2] https://developer.arm.com/documentation/101427/0101/?lang=en [3] https://developer.arm.com/documentation/102099/0001/?lang=en > > Thanks, > Leo