Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp890596pxp; Wed, 16 Mar 2022 20:20:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ0DPQ5ciOIvNMty2yCSvxECNkY21xt623gtKLug4WkhIcGy0usVVPCW+yZD4eDats4QDn X-Received: by 2002:a17:90b:33cb:b0:1bf:844b:44b4 with SMTP id lk11-20020a17090b33cb00b001bf844b44b4mr2984962pjb.153.1647487216314; Wed, 16 Mar 2022 20:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647487216; cv=none; d=google.com; s=arc-20160816; b=uzdBeHRXA2cOf/ypfQnp3qEJngOut1urOURNa8DD33rPegZhYJNEM4iv3UX0oPu/t9 BEdMyxd0L4/donF/435L3P9oYKMVKotJYuUo4djehJ+YWM3CS4A/wKPWwGSRiUksyxTy SjfiEoP6JnwjcW0dHFteBnLGcwSIZ9PzgQhFqgJPOqvhI0ofR9fBONyvkxb8yD0FldY0 Wr4z/p0h47FaSDJfYnPxTJsH3BBLux8edzVMg2/PPnb/JGEUFV1+/Agd+p0/5yXvJLwU mixEQutvqlmAu/0oi1ejjYQmBZWo6S78TCF5eavO6fTQ9+hs034vyT5WPDdxRUefEm1/ eing== 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:references:cc :to:from:subject; bh=cmvitm+AA+cC2Na95RstNABp8j8+dZL1vg8EypGvFcs=; b=tVdyIA6jn0rcG7WJKd6XJQ0Vr0qGOwhOCztZLmDJhwBuFnPnxp1xfFbcPXD251og/u W2Oa5/aY49R7IFE4bQqKqRkedS4zPAChh2I/YTGFyTH7Y3/p0u/uoyn7ugusQW/RcAPW 8OG86MIWt/SxcW7C6UKOc2PLr5QvGhkrt9npLAU2JHXDausnP/ZqQTcL07pkRpxXXaBF bYuzn9FakJM32/IKas9gmZdXa35X6NJdjVYiNm9vN1XNOHSqBdBD1cxG0/BR37VWYg6I w3uCKcpb+lOS1FUx9YD6MPayLWpJvkHx82MQvV6AXoEjQKKhZ6vCya+dEg7f3L3yScNb RAWg== 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:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a24-20020a656558000000b003816043f0f6si853718pgw.747.2022.03.16.20.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 87FE123BE6; Wed, 16 Mar 2022 20:20:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245567AbiCPLqL (ORCPT + 99 others); Wed, 16 Mar 2022 07:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234182AbiCPLqJ (ORCPT ); Wed, 16 Mar 2022 07:46:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8EFCE631B; Wed, 16 Mar 2022 04:44:55 -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 3B7101515; Wed, 16 Mar 2022 04:44:55 -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 1DF3E3F85F; Wed, 16 Mar 2022 04:44:50 -0700 (PDT) Subject: Re: [PATCH v2 2/2] perf mem: Support HITM for when mem_lvl_num is used From: German Gomez To: Ali Saidi , leo.yan@linaro.org 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> Message-ID: <7b3aaa4d-5194-a729-f8ad-d55ada7fa58f@arm.com> Date: Wed, 16 Mar 2022 11:43:52 +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: <172ce478-b539-2aa4-0470-1b96c6b8169b@arm.com> 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 15/03/2022 18:44, German Gomez wrote: > On 14/03/2022 18:37, Ali Saidi wrote: >> Hi German and Leo, >> >> On Mon, 14 Mar 2022 18:00:13 +0000, German Gomez wrote: >>> 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* >> 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, German > > | $ cat /sys/devices/system/cpu/cpu0/cache/index4/{level,shared_cpu_list} > | 4 > | 0-3 > > Would it be a good idea to obtain the system cache level# from sysfs? > >>> *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) >> And in the future they're not able to build >3. German and Leo if there aren't >> strong objections I think the best path forward is for me to respin these >> assuming only 3 levels and if someone builds 4 in a far-off-future we can always >> change the implementation then. Agreed? >> >> Thanks, >> Ali >>