From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F7B7C433EF for ; Fri, 1 Jul 2022 17:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oClZoXkvlOVmBUdgGH4GrrZj2uWSvG9HWHVE4V5X3jA=; b=Cclq1BvBVuak+rYZKW7+XPRGLj v6jpalWzMfwPJ2fjWyG6NdBEwU9/eCR9ZOGU4mm9djuvjwpHpoG09gKgbguvdJzyV+h2UILErStE2 2iJRhtF/36E8vTdEsxesif9LlsT3MV+jrMo6moSZ4H+yVoWDr0hdteMj6fuOnzwRh15VkXFUhXGHS e/BakJxGJWN9gYyWktGA7dX1RAb3PzqQDTQkW2lu9hppPUqyOxOA+3aRHfI1zO+R0qu3pJJk5jxcq HpMi7640zoto71XQxN5Qypq6/0PzqQb/+d853zMkL2hU2lrZeT/fsGYoswHqHE7QGBwmKwEWptw6A eTRyCrkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7KJc-006CBr-43; Fri, 01 Jul 2022 17:20:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7KJX-006C9a-Qs for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 17:20:21 +0000 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-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220701_102019_989594_B33B5163 X-CRM114-Status: GOOD ( 17.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel