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 E77B3C433EF for ; Thu, 19 May 2022 15:29:42 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p62UwE7Ol9bD6Aubyv/kx5Ub4yZ0loeeFBohB7574Gs=; b=c6T6WwAw2WG/85 yyHffNaQR+7suXvbOWV7GSawGAd+MZHXvvKm9u/zzSTIojRe1mRY/y+i6eMzRI1GS1fdNOA2YEXWh ZZRbDKywM0u8ugX6dI6W+SgT05ZW17KWXtO6XWIeKkYnPTxltJLpyNOpoEALt8e/gK6M0aOHqIrVW aRY+m5YBjUpvZIeFl42p7LGibNYC09J5RPtNRPbCFJscbTTklpuASQsbYGThznw8L9tEH59vLh/2Z 0PjI8rDHVoEeCnItnROVQWMLtKxkW4Vwfv5kd1nzxIg2dOqi2ta/CEk/3UCUfWKPUpQ+niMMrNbeb /4+2P/wvEgIrSYczEJfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nri4P-007wG2-Me; Thu, 19 May 2022 15:28:11 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrhwL-007sHY-Sy for linux-arm-kernel@lists.infradead.org; Thu, 19 May 2022 15:19:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652973587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eFxAkTiFYx/27rNrxiNuMe1vTCHfN4tVz87m6TJA89U=; b=B2oj3/R990UZNNByTo2RVkykLqCQSUcLhpYy3n8l3nRLTn7azOrT5InNSqYj7sgLF9NJnj IELQX/FP1DgvVPcWG/fahxDvsD1/KkFoVZqJjs4PxAyALkIO1/OmEXZMOO8BGK+rtCNFgs Hg0+YWbnBA8xvWdaDJbZZfjDWleXxGs= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-CheMknzRPwqogY2MXiNZvQ-1; Thu, 19 May 2022 11:16:57 -0400 X-MC-Unique: CheMknzRPwqogY2MXiNZvQ-1 Received: by mail-qv1-f69.google.com with SMTP id v12-20020a0cc1cc000000b00461e65b1b01so4504881qvh.18 for ; Thu, 19 May 2022 08:16:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=eFxAkTiFYx/27rNrxiNuMe1vTCHfN4tVz87m6TJA89U=; b=6F8hMrvD44YOG+ggdSUgyr/7zf3XS6rCVflf9ZssjLALaqa+SdU9qzupu6WZjsQRHY XGP735P9ZVFNo1sX0oDyBwCh/rManu5RpFQ8DkC5QGO4sry4GlpiQ31hfyupP7T/OWun tZbAKHyoEuK9QcEm13jrQCYAMC2fKNBBJqDB4rBbh5pyCQiJE0+5HzaQvbH4am3VygA0 YNW4y1aflrRJO8zCdCruQwROmrH0wG2ZTFTxy1auyWQisYPQ9G0u1VMsOz1Q/gMtGfSR xtrGG/EOCrk/DiXqaBsdC3i/xOise0HNMEkpDdyxZ/LllS217HBsA2RbYvHW2DsdJ5Kh aloQ== X-Gm-Message-State: AOAM532Lq9FFosAntnumxhbTjamtJ/C08pn5lV0UVzGqHY1+zcpA0KLL 1jYg8SmgqCGjIopKoilHf6kdqnU2FrSHlVHrIaBrmVeSALzmH5R4X4H1b3kKbupw2ovsURzZUfg ELWUST6krDtQzffn1rQHwo6zN44e48zfQiPA= X-Received: by 2002:a05:622a:15cb:b0:2f3:f90f:1939 with SMTP id d11-20020a05622a15cb00b002f3f90f1939mr4332871qty.374.1652973416662; Thu, 19 May 2022 08:16:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvxlpYrFwSJ+r9PedV8x0+cauaFMXyvayTXrq2OHyietf7KJSz5bBSaj+kURa8rNtS/vfhAg== X-Received: by 2002:a05:622a:15cb:b0:2f3:f90f:1939 with SMTP id d11-20020a05622a15cb00b002f3f90f1939mr4332845qty.374.1652973416375; Thu, 19 May 2022 08:16:56 -0700 (PDT) Received: from [192.168.1.86] (pool-173-48-131-43.bstnma.fios.verizon.net. [173.48.131.43]) by smtp.gmail.com with ESMTPSA id c190-20020ae9edc7000000b0069fc13ce1e3sm1347636qkg.20.2022.05.19.08.16.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 08:16:55 -0700 (PDT) Message-ID: <32e5a3b7-9294-bbd5-0ae4-b5c04eb4e0e6@redhat.com> Date: Thu, 19 May 2022 11:16:53 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v8 0/4] perf: arm-spe: Decode SPE source and use for perf c2c To: Leo Yan , Arnaldo Carvalho de Melo Cc: Ali Saidi , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, german.gomez@arm.com, benh@kernel.crashing.org, Nick.Forrington@arm.com, alexander.shishkin@linux.intel.com, andrew.kilroy@arm.com, james.clark@arm.com, john.garry@huawei.com, Jiri Olsa , kjain@linux.ibm.com, lihuafei1@huawei.com, mark.rutland@arm.com, mathieu.poirier@linaro.org, mingo@redhat.com, namhyung@kernel.org, peterz@infradead.org, will@kernel.org References: <20220517020326.18580-1-alisaidi@amazon.com> <20220518041630.GD402837@leoy-ThinkPad-X240s> From: Joe Mario In-Reply-To: <20220518041630.GD402837@leoy-ThinkPad-X240s> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jmario@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_081950_038756_03B7D4D0 X-CRM114-Status: GOOD ( 29.85 ) 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 On 5/18/22 12:16 AM, Leo Yan wrote: > Hi Joe, > > On Tue, May 17, 2022 at 06:20:03PM -0300, Arnaldo Carvalho de Melo wrote: >> Em Tue, May 17, 2022 at 02:03:21AM +0000, Ali Saidi escreveu: >>> When synthesizing data from SPE, augment the type with source information >>> for Arm Neoverse cores so we can detect situtions like cache line >>> contention and transfers on Arm platforms. >>> >>> This changes enables future changes to c2c on a system with SPE where lines that >>> are shared among multiple cores show up in perf c2c output. >>> >>> Changes is v9: >>> * Change reporting of remote socket data which should make Leo's upcomping >>> patch set for c2c make sense on multi-socket platforms >> >> Hey, >> >> Joe Mario, who is one of 'perf c2c' authors asked me about some >> git tree he could clone from for both building the kernel and >> tools/perf/ so that he could do tests, can you please provide that? > > I have uploaded the latest patches for enabling 'perf c2c' on Arm SPE > on the repo: > > https://git.linaro.org/people/leo.yan/linux-spe.git branch: perf_c2c_arm_spe_peer_v3 > > Below are the quick notes for build the kernel with enabling Arm SPE: > > $ git clone -b perf_c2c_arm_spe_peer_v3 https://git.linaro.org/people/leo.yan/linux-spe.git > > Or > > $ git clone -b perf_c2c_arm_spe_peer_v3 ssh://git@git.linaro.org/people/leo.yan/linux-spe.git > > $ cd linux-spe > > # Build kernel > $ make defconfig > $ ./scripts/config -e CONFIG_PID_IN_CONTEXTIDR > $ ./scripts/config -e CONFIG_ARM_SPE_PMU > $ make Image > > # Build perf > $ cd tools/perf > $ make VF=1 DEBUG=1 > > When boot the kernel, please add option "kpti=off" in kernel command > line, you might need to update grub menu for this. > > Please feel free let us know if anything is not clear for you. > > Thank you, > Leo > Hi Leo: Thanks for getting this working on ARM. I do have a few comments. I built and ran this on a ARM Neoverse-N1 system with 2 numa nodes. Comment 1: When I run "perf c2c report", the "Node" field is marked "N/A". It's supposed to show the numa node where the data address for the cacheline resides. That's important both to see what node hot data resides on and if that data is getting lots of cross-numa accesses. Comment 2: I'm assuming you're identifying the contended cachelines using the "peer" load response, which indicates the load was resolved from a "peer" cpu's cacheline. Please confirm. If that's true, is it possible to identify if that "peer" response was on the local or remote numa node? I ask because being able to identify both local and remote HitM's on Intel X86_64 has been quite valuable. That's because remote HitM's are costly and because it helps the viewer see if they need to optimize their cpu affinity or what node their hot data resides on. Last Comment: There's a row in the Pareto table that has incorrect column alignment. Look at row 80 below in the truncated snipit of output. It has an extra field inserted in it at the beginning. I also show what the corrected output should look like. Incorrect row 80: 71 ================================================= 72 Shared Cache Line Distribution Pareto 73 ================================================= 74 # 75 # ----- HITM ----- Snoop ------- Store Refs ------ ------- CL -------- 76 # RmtHitm LclHitm Peer L1 Hit L1 Miss N/A Off Node PA cnt Code address 77 # ....... ....... ....... ....... ....... ....... ..... .... ...... .................. 78 # 79 ------------------------------------------------------------------------------- 80 0 0 0 4648 0 0 11572 0x422140 81 ------------------------------------------------------------------------------- 82 0.00% 0.00% 0.00% 0.00% 0.00% 44.47% 0x0 N/A 0 0x400ce8 83 0.00% 0.00% 10.26% 0.00% 0.00% 0.00% 0x0 N/A 0 0x400e48 84 0.00% 0.00% 0.00% 0.00% 0.00% 55.53% 0x0 N/A 0 0x400e54 85 0.00% 0.00% 89.74% 0.00% 0.00% 0.00% 0x8 N/A 0 0x401038 Corrected row 80: 71 ================================================= 72 Shared Cache Line Distribution Pareto 73 ================================================= 74 # 75 # ----- HITM ----- Snoop ------- Store Refs ----- ------- CL -------- 76 # RmtHitm LclHitm Peer L1 Hit L1 Miss N/A Off Node PA cnt Code address 77 # ....... ....... ....... ....... ....... ...... ..... .... ...... .................. 78 # 79 ------------------------------------------------------------------------------- 80 0 0 4648 0 0 11572 0x422140 81 ------------------------------------------------------------------------------- 82 0.00% 0.00% 0.00% 0.00% 0.00% 44.47% 0x0 N/A 0 0x400ce8 83 0.00% 0.00% 10.26% 0.00% 0.00% 0.00% 0x0 N/A 0 0x400e48 84 0.00% 0.00% 0.00% 0.00% 0.00% 55.53% 0x0 N/A 0 0x400e54 85 0.00% 0.00% 89.74% 0.00% 0.00% 0.00% 0x8 N/A 0 0x401038 Thanks again for doing this. Joe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel