Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp959686pxp; Wed, 16 Mar 2022 22:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLGrOwEBi9YkQOdURy1E+fZ3WCcea6kpSLLrViuNNog3+5aHoWECpKgEVyGtM+9WaTx5am X-Received: by 2002:a05:6a00:1248:b0:4f7:db0:4204 with SMTP id u8-20020a056a00124800b004f70db04204mr2986375pfi.27.1647495672878; Wed, 16 Mar 2022 22:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647495672; cv=none; d=google.com; s=arc-20160816; b=wqQrAOwobz06u+/eSGhhFfo8RE0lEXBfp9KWevAdPfMLZjS/TWp+I9Gy7zn8dKiRhl 8h/x9RPNW2Gutj+DyUHFWyz8bVOzqoXKEswQHwS41Jg5JHBwa6qRmih40lAYlO9qbndp RLXze93R5WEwPmtl2s/IlyOxRrRdN8Z/BbWATiq7vdH0+H0ZZ4UpWf2yebM/wzcTqF5x HK6AHIV/sSbHgMyvOjFpUnOehnFzX7V1xF3p33taccBNFCCulYmb+UV3MvGDJGA+uvoy eMgm2Tgtbu3DdCNwXW0uFHYX8tbJ2lbuKomD6o0uw17YZBX16ruscTP/7Bn1trksloox tlAg== 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=7EiPX4nwyFxkCMl5Zph45L00zKhuqkgXyCdZ7GMH3Gg=; b=RH+RCestV3KYz+nKim1wegpJ9FHYO45J/5LB9JqQZgVURucrtS5qZTPYYlG7pWMdHe 4JsrULxSdQscnXWQaWHJx0bA//EWD7x6A5UII1V/zfVrwkhvHF7ml+NRXjFs3wHNYCNF A2ru3/Cf8IQIxbk95qEbAALh2FkSbYzJMfwKjRFdDw3AgmgPWM4ZfR9nDzXrwrZZEfoS i+tfDcTNX+3mOkYFnAL1IxXp+DRufRBUcjbBEnuEwjnXlfCKa4KfGpd/zvXHTADEgQO3 KT7zh+m1LfeFB1Hy/7UiID+z+5B9Yxa374cuPMXtDTZP2TZj65wBOFQP1Igq6N/Yu6Ja 4Yzw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 135-20020a63018d000000b003816043eff3si1049011pgb.488.2022.03.16.22.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:41:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85D4917DCA7; Wed, 16 Mar 2022 21:49:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357112AbiCPPPD (ORCPT + 99 others); Wed, 16 Mar 2022 11:15:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357975AbiCPPOL (ORCPT ); Wed, 16 Mar 2022 11:14:11 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 462066C1D6; Wed, 16 Mar 2022 08:12:06 -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 100031515; Wed, 16 Mar 2022 08:11:58 -0700 (PDT) Received: from [10.57.6.128] (unknown [10.57.6.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1FB673F7D7; Wed, 16 Mar 2022 08:11:54 -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: <20220314183721.3198-1-alisaidi@amazon.com> <172ce478-b539-2aa4-0470-1b96c6b8169b@arm.com> <7b3aaa4d-5194-a729-f8ad-d55ada7fa58f@arm.com> <20220316124208.GA310478@leoy-ThinkPad-X240s> From: German Gomez Message-ID: <1637567b-42df-57d5-2987-939ffbf451ef@arm.com> Date: Wed, 16 Mar 2022 15:10:55 +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: <20220316124208.GA310478@leoy-ThinkPad-X240s> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 16/03/2022 12:42, Leo Yan wrote: > On Wed, Mar 16, 2022 at 11:43:52AM +0000, German Gomez wrote: > > [...] > >>>>> 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* >>>> To date no one has built 4 level though. Everyone has only built three. >>> The N1SDP board advertises 4 levels (we use it regularly for testing perf patches) >> That said, it's probably the odd one out. >> >> I'm not against assuming 3 levels. Later if there's is a strong need for L4, indeed we can go back and change it. > Thanks for the info. > > For exploring cache hierarchy via sysFS is a good idea, the only one > concern for me is: can we simply take the system cache as the same > thing as the highest level cache? If so, I think another option is to For Neoverse, it should be. LL_CACHE_RD pmu event says (if system cache is implemented): * If CPUECTLR.EXTLLC is set: This event counts any cacheable read transaction which returns a data source of 'interconnect cache'. > define a cache level as "PERF_MEM_LVLNUM_SYSTEM_CACHE" and extend the > decoding code for support it. > > With PERF_MEM_LVLNUM_SYSTEM_CACHE, it can tell users clearly the data > source from system cache, and users can easily map this info with the > cache media on the working platform. > > In practice, I don't object to use cache level 3 at first step. At > least this can meet the requirement at current stage. Ok, I agree. I think for now it is a good compromise. Detecting the caches seems like an additional/separate perf feature. Thanks, German > Thanks, > Leo