Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4862268ioa; Wed, 27 Apr 2022 12:53:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1NnsqUCtAoAOvXe94cmg+qklu7GZ31CFeOqaHko/Fe/nlWE8DzL6aLUm88BQXrjusb3cf X-Received: by 2002:a17:907:1c92:b0:6f0:f17:14a with SMTP id nb18-20020a1709071c9200b006f00f17014amr27280208ejc.475.1651089208552; Wed, 27 Apr 2022 12:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651089208; cv=none; d=google.com; s=arc-20160816; b=WhLujtIWXYuXw87KLul/ZYVPyWz+4r8OqGQQUp/D+H6pzh8lcd3b709gTbELyJ3czJ A6Tw2PzhLyzMeSbn2S9HOu8bsh1mx+z42VBcCMo1j4q6qLmVqhsDaGa1hsWp1n5TojtT tJpZRX7k7FLcKUrtzMCAWnCMPpqW4ZmqyCJbtngX76wTfc7yPQLSHPtPUa+QT3r43ya6 yeVzyqgfe0ZM2dc7tRUzwlO1fpyFJdFFdKQhQ4YA8kHXQqauhk9nfL0dVEAVPmaqGquo noqtgSwe5dv43qVRMQHuLX0liJp4+gEhqwwXhyxOCjXJxG1XAdrD2ceIgCkVo8q5AxhZ wyoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jB5IX01aDu90Lv/YokJC8SfvVDq8FS9Xfn164H4/F6Q=; b=hftRxNIdERqNZXi8YIjsOgQSY4rSCqPT/e7lnIiDZ973n2tzm3ef+kObuwXVNLv2zE cU8YEKBn9AyreerZkNu759j+gkMNbgNvDhveFzPAjNBN9OSGWto0DHLU5oWuUJTseF22 Oipc95sBRyAdkDRk4Rn3BEUeSru8RsosBP/vFUuYV5o/LGbhxZKbwvinYBHv3T/WIXFa HYL5itQYB0tqrlrdwI81/G6RoGi5OQcBWkVE2ivTF2tWWMQAJzJZL8AWRD0gg9Co0bBV iwKruTYKn3xwIhrSPlfL1x1NNFS6PzsNu5J9bO0bqwjfIbv+KRamTkckMJth/AmYNiNg Vyxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XePA+Zw0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n15-20020a1709061d0f00b006ef9401ad3asi1922320ejh.126.2022.04.27.12.53.05; Wed, 27 Apr 2022 12:53:28 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=XePA+Zw0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbiD0TdT (ORCPT + 99 others); Wed, 27 Apr 2022 15:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234440AbiD0Tcz (ORCPT ); Wed, 27 Apr 2022 15:32:55 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8C17CE; Wed, 27 Apr 2022 12:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651087776; x=1682623776; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7DM3DwoVa43dxbl3zZEhqiJA/RQy10C5jWu7fExDLWg=; b=XePA+Zw0OIw1HmjPLJvRtDW2CifXTnA45AB1dyPJfFhERYISgPTBFB0O b+5krKVUln4iqpDsgnXaaiRjwdpeoQOIm7M1AdPmubRU4N1dRraxSK2jb 92ELijKTYa7fwhR0KdXRoRvcem24oDi47DwDQPcjMP1xZpEIaddpIkl3y YRzVqAPcWTJOEhApsMeGZB9atY+csx1Q/mYAcc2RxM4BFxOp+7yLmfI3O eVaNx2AmPcA1A+Zu0q76umSKTNd4XNeXhj7bDRo0vkjM7L9wqm2Z8vzRd Qa54Svmz6ImWTxNXL3LojEbWLClqkmCTQk2xIS98wQp72unLKwpq1G0vo w==; X-IronPort-AV: E=McAfee;i="6400,9594,10330"; a="246607217" X-IronPort-AV: E=Sophos;i="5.90,294,1643702400"; d="scan'208";a="246607217" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.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> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 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/