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 3139AC433EF for ; Wed, 27 Apr 2022 19:30:57 +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-Type: Content-Transfer-Encoding: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=21BQgd9rUNLKx/ozItSOT8PtvgtoXPqctxAptqRaOK0=; b=xRsxd+icFCuaxF L4SyVqCiooB0RxH7yCGxIfQw80AJnx2BTYlVjvKY4VOrX08OFpHxmk4hHrhPXWYHYI9FzgfwNqKhE I8ZrTbPYd3gdbOOIoJiA/hNB5tx2yNibasJJ9bhrLxVM8/iRJdCCWm3BDOKRwY9/AeakFHbBUwKnx ZM3eZIKoA0g84KNiMEbAAfb7eIzAXp7g2wXV+lHC1GndFgdczIIJtjaOtK6GYJmQ8dBQecL//dLSk Gqm5HK9vy82wclT73iiQiSUCAtJ1IbAvVANTwOCUnhZ3BBOxCZ6CZ+rndMgPDdEDzMJG+MobuTSTu tQZsg5lelW1xtdSsmelw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njnM9-003IZ0-7I; Wed, 27 Apr 2022 19:29:46 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njnM3-003IWD-NC for linux-arm-kernel@lists.infradead.org; Wed, 27 Apr 2022 19:29:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651087779; x=1682623779; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7DM3DwoVa43dxbl3zZEhqiJA/RQy10C5jWu7fExDLWg=; b=Gb4l2mwFEAW4M/TGubg5vJaklUqIwYc7lMcOUZFTyxL5+2f4wrfytYMD a4H+AyJ3kYxgznWqvcsD1guo+KawGl5WV+GhqPXyzk1YZAiGz+EfVTazb yJcmToXR+SvFbyEb16H07LQockrnc2d6vZIHiY09NNtWRVETIE19hevfU MSNhtpVBaB6P1N53bLX0jjyAP8KSFN8wZUGryyTE6Z7oF1UZGfMNxP4fL 9P7jQGhI2x+V9Sqm0yuT52836CW5h4BBv/xScLmaK/zUG7qJJdnyt/Bao BE3LbXzCfAhHdOJlSO21n7Xxa7/27R4L/pzJzJXn0VZSMECkKTt8/QDXG g==; X-IronPort-AV: E=McAfee;i="6400,9594,10330"; a="328988442" X-IronPort-AV: E=Sophos;i="5.90,294,1643702400"; d="scan'208";a="328988442" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2022 12:29:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,294,1643702400"; d="scan'208";a="533389441" Received: from linux.intel.com ([10.54.29.200]) by orsmga006.jf.intel.com with ESMTP; 27 Apr 2022 12:29:36 -0700 Received: from [10.212.137.53] (kliang2-MOBL.ccr.corp.intel.com [10.212.137.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 90C1C58096C; Wed, 27 Apr 2022 12:29:33 -0700 (PDT) Message-ID: <9923422f-2dd3-9951-5814-ab3972e67758@linux.intel.com> Date: Wed, 27 Apr 2022 15:29:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v5 2/5] perf: Add SNOOP_PEER flag to perf mem data struct Content-Language: en-US To: Leo Yan Cc: Andi Kleen , Ali Saidi , Nick.Forrington@arm.com, acme@kernel.org, alexander.shishkin@linux.intel.com, andrew.kilroy@arm.com, benh@kernel.crashing.org, german.gomez@arm.com, 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 References: <20220422212249.22463-1-alisaidi@amazon.com> <20220423063805.GA559531@leoy-ThinkPad-X240s> <8e09af67-a416-4ead-b406-6c8b998de344@linux.intel.com> <20220424114302.GB978927@leoy-ThinkPad-X240s> <20220427161908.GE562576@leoy-ThinkPad-X240s> From: "Liang, Kan" In-Reply-To: <20220427161908.GE562576@leoy-ThinkPad-X240s> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220427_122939_875502_62746D9B X-CRM114-Status: GOOD ( 27.74 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 4/27/2022 12:19 PM, Leo Yan wrote: > Hi Kan, > > On Mon, Apr 25, 2022 at 01:01:40PM -0400, Liang, Kan wrote: >> >> >> On 4/24/2022 7:43 AM, Leo Yan wrote: >>> On Sat, Apr 23, 2022 at 05:53:28AM -0700, Andi Kleen wrote: >>>> >>>>> Except SNOOPX_FWD means a no modified cache snooping, it also means it's >>>>> a cache conherency from *remote* socket. This is quite different from we >>>>> define SNOOPX_PEER, which only snoop from peer CPU or clusters. >>>>> >> >> The FWD doesn't have to be *remote*. The definition you quoted is just for >> the "L3 Miss", which is indeed a remote forward. But we still have >> cross-core FWD. See Table 19-101. >> >> Actually, X86 uses the PERF_MEM_REMOTE_REMOTE + PERF_MEM_SNOOPX_FWD to >> indicate the remote FWD, not just SNOOPX_FWD. > > Thanks a lot for the info. > >>>>> If no objection, I prefer we could keep the new snoop type SNOOPX_PEER, >>>>> this would be easier for us to distinguish the semantics and support the >>>>> statistics for SNOOPX_FWD and SNOOPX_PEER separately. >>>>> >>>>> I overlooked the flag SNOOPX_FWD, thanks a lot for Kan's reminding. >>>> >>>> Yes seems better to keep using a separate flag if they don't exactly match. >>>> >> >> Yes, I agree with Andi. If you still think the existing flag combination >> doesn't match your requirement, a new separate flag should be introduced. >> I'm not familiar with ARM. I think I will leave it to you and the maintainer >> to decide. > > It's a bit difficult for me to make decision is because now SNOOPX_FWD > is not used in the file util/mem-events.c, so I am not very sure if > SNOOPX_FWD has the consistent usage across different arches. No, it's used in the file util/mem-events.c See perf_mem__snp_scnprintf(). > > On the other hand, I sent a patch for 'peer' flag statistics [1], you > could review it and it only stats for L2 and L3 cache level for local > node. If it's for the local node, why don't you use the hop level which is introduced recently by Power? The below seems a good fit. PERF_MEM_LVLNUM_ANY_CACHE | PERF_MEM_HOPS_0? /* hop level */ #define PERF_MEM_HOPS_0 0x01 /* remote core, same node */ #define PERF_MEM_HOPS_1 0x02 /* remote node, same socket */ #define PERF_MEM_HOPS_2 0x03 /* remote socket, same board */ #define PERF_MEM_HOPS_3 0x04 /* remote board */ /* 5-7 available */ #define PERF_MEM_HOPS_SHIFT 43 Thanks, Kan > > The main purpose for my sending this email is if you think the FWD can > be the consistent for both arches, and even the new added display mode > is also useful for x86 arch (we can rename it as 'fwd' display mode), > then I am very glad to unify the flag. > > Thanks, > Leo > > [1] https://lore.kernel.org/lkml/20220427155013.1833222-5-leo.yan@linaro.org/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel