Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp85984imn; Fri, 1 Jul 2022 10:27:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vQwP0GVsDuFs3kTCsygra+iu7edhrj8nu65Xg3/reMLZSXplEsGdbmhoHXYr+D4G+HC3he X-Received: by 2002:a17:90a:e503:b0:1ec:84b2:6404 with SMTP id t3-20020a17090ae50300b001ec84b26404mr19715202pjy.169.1656696452623; Fri, 01 Jul 2022 10:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656696452; cv=none; d=google.com; s=arc-20160816; b=KumGWgt1Ln/0jb45YBKLQ5+KJXYeVnJoioZi4d8kqTTXUXhmZ+SoX4ynZhrDdXpeyL dBCZs9InoZixC2mQ9cPZ0KLZIKE8dUFFfZMe6NHimbBcMFmlPe5wzs1qW+VcFlFEqdYB 21emf0hJ8XrmI0MZgWJ7L4vJ3mz72XxbuypT8dZRAhaBvh2adeSh2gLo2UlQcJNYkpej WyW/YoCVLWV3T1T4FdVw0UxPihX4cFwVti2U/WvLZVuzKEfOr1P2So6ZzC8La8r1UXAb 0CKT6VIOPLuO2pmY+T2Dj7mO2oJhTAvRRk6Oj2zDS98WmSWB30hs22bBH/nBEzrwYrYO qt2A== 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; bh=artvNK4wT5cbIYg0T/81Z3tETYUfJMNAwnHH8/EpeEE=; b=kEzRTQTmPYURDjxsLu9sF+70jK/xLQRKY2ivXjnIJzpcSeuCOwS9FIA/SiO0e9aNvE Kb00wPd00Y6EgcmSCsnpVE5WYAFpQIEpLaAh1ErRcdbopmHRMSonpsj/SLLqt2g+Wkt3 BXmUK6EvxKbI2N3rHmGg1/Ybxq1yckGFQCw5MrSOZvUxAGheabdBoW/20+m5CW0T2VM1 lF+s327bwkyYTcpBMoY/GFRvsfAgGqn/usHKQnlarlKeq/5a2KB19MOHkeFzSRQx0QmU EjtOFI/SDXj4jsIYV6EHvu+XcT48baPp3CNg3EAQEdOE+4NHaMfNyd+xrbjz+W46yZdm GZIw== 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 y2-20020a170902700200b0016a16419961si2098985plk.55.2022.07.01.10.27.05; Fri, 01 Jul 2022 10:27:32 -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 S232184AbiGARUR (ORCPT + 99 others); Fri, 1 Jul 2022 13:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232086AbiGARUP (ORCPT ); Fri, 1 Jul 2022 13:20:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1743B2E6BF for ; Fri, 1 Jul 2022 10:20:13 -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 DFB54113E; Fri, 1 Jul 2022 10:20:12 -0700 (PDT) Received: from [10.1.196.218] (eglon.cambridge.arm.com [10.1.196.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B5D33F792; Fri, 1 Jul 2022 10:20:11 -0700 (PDT) Subject: Re: [PATCH RESEND] perf/marvell_cn10k: Add MPAM support for TAD PMU To: Tanmay Jagdale , Robin Murphy , Will Deacon Cc: "mark.rutland@arm.com" , "robh@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Sunil Kovvuri Goutham , Linu Cherian , Bharat Bhushan , Amit Singh Tomar References: From: James Morse Message-ID: <72856daa-ef83-caee-b0d0-6b5018d1bafa@arm.com> Date: Fri, 1 Jul 2022 18:20:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,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 Tanmay, On 27/06/2022 14:18, Tanmay Jagdale wrote: >> On 2022-06-24 13:14, Will Deacon wrote: >>> On Sat, May 28, 2022 at 12:26:47AM +0530, Tanmay Jagdale wrote: >>>> The TAD PMU supports following counters that can be filtered by MPAM >>>> partition id. >>>> - (0x1a) tad_alloc_dtg : Allocations to DTG. >>>> - (0x1b) tad_alloc_ltg : Allocations to LTG. >>>> - (0x1c) tad_alloc_any : Total allocations to DTG/LTG. >>>> - (0x1d) tad_hit_dtg : DTG hits. >>>> - (0x1e) tad_hit_ltg : LTG hits. >>>> - (0x1f) tad_hit_any : Hit in LTG/DTG. >>>> - (0x20) tad_tag_rd : Total tag reads. >>>> >>>> Add a new 'partid' attribute of 16-bits to get the partition id >>>> passed from perf tool. This value would be stored in config1 field >>>> of perf_event_attr structure. >>>> >>>> Example: >>>> perf stat -e tad/tad_alloc_any,partid=0x12/ >>>> >>>> - Drop read of TAD_PRF since we don't have to preserve any >>>> bit fields and always write an updated value. >>>> - Update register offsets of TAD_PRF and TAD_PFC. >>> >>> It would be great if you could document some of this under >>> Documentation/admin-guide/perf like many of the other PMU drivers have >>> done. >> >> Especially documenting how the user obtains the required partid value to >> pass. > We created MPAM partitions using the resctrl filesystem interface. > Example: > $ cd /sys/fs/resctrl > $ mkdir p1 > $ echo "L3:0=f" > p1/schemata (configure 4 L3 cache ways) > $ mkdir p2 > $ echo "L3:1=ff0" > p2/schemata (configure 8 L3 cache ways) > > Here directory name 'p1' creates a MPAM partid 0x1 and 'p2' creates > 0x2 and so on. You can't rely on this. See the KNOWN_ISSUES file in the the mpam tree: PARTID 0 should be reserved for unknown hardware. In fact any number of PARTID may be reserved for in-kernel users. You can't guess what the offset might be from user-space. > Right now, there is no file which exposes the partid to userspace. > We must rely on the sequential order in which we create partitions > via resctrl and use that to derive the partid. If you dig in the MPAM tree you'll find how I intend to solve this for exposing the MPAM counters via perf. But this is a user-space visible change to resctrl, so it will need to wait until all the refactoring is done and the bulk of the MPAM driver is upstream. Thanks, James