Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4923101pxb; Tue, 5 Oct 2021 13:23:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBOkdSOvH2JsVoXi+AauJV17pHudO0I58AZg2He2i9iC7Sj3/cLFWIDgZzqbc0zVQmeLd0 X-Received: by 2002:a17:90a:8404:: with SMTP id j4mr6090123pjn.204.1633465439633; Tue, 05 Oct 2021 13:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633465439; cv=none; d=google.com; s=arc-20160816; b=n0SG4VuNHZmxwvfWtu8lS9RMAJRD49CoJA0vOx9MzDG5i2QdxyQt1tw9I/1uobvGpL E0yn/icJZ/jqLpUmfp7zq/uGFXNH6G7HWBMMBuZkHMX24PrdWnVBtU+n2ZP6/Kb/KUI3 SJtUAyS+nMyv4A9zuLMWAB4HY9uyJeufs6hvw7Wb/M0AJyyguZv/9aSlMlhBoa8yrOuf Ga7vlr/qDpQl+O/AN0Pr8uldg2mk+SlrEDaBfjtswrH/pZUk7A9PczBBkNmL3ezlsxsj WcWAFM72dLJAJxdJ6IAehcape8qikMnu4Mmsmf5J/UjHWvO6xagcPJaw9bZF3YYS3M61 pQeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+8X5bhOq6FZhcb3qINVEcr3c5ULv6DfdL9C3Qj2SrpQ=; b=N+f5vi8xu0jFk1j8YVAvHnbnZgMXiYVETtxUFE0CFItqfitnC44wLHxB8uy0KCzZn/ Kw2NxVPS3sS8FIggLGqQ7vCn9mgpFjmfqLT2NeUi5KXPsOA7Mpa9HEvWzpY63mH9SaR5 MkXifqBJpuTbGNXSCN6pNrLaEtKHS8RGcFjuecV7uiYaCqb4BiZlP4UF9mez55cO7K8U Q5DuUiq+9+Pv8mZDbcKuZiHT5oT4Yb8CFUpkgPj2NBj6UkshQBnyPc9C53h1r0FBXA9w 6isqiEXEtA28vZ4/JYQ4wmaA77neKJjxYb5XOYPualgaGNNm8bjfQLcHWkdO4HiAxya1 FVGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MUpHCsfn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cp16si21373335plb.461.2021.10.05.13.23.47; Tue, 05 Oct 2021 13:23:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MUpHCsfn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235949AbhJEUYl (ORCPT + 99 others); Tue, 5 Oct 2021 16:24:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbhJEUYk (ORCPT ); Tue, 5 Oct 2021 16:24:40 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EFD6C061749; Tue, 5 Oct 2021 13:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+8X5bhOq6FZhcb3qINVEcr3c5ULv6DfdL9C3Qj2SrpQ=; b=MUpHCsfnUDPsrJaINQKVwTGzod SQHHHLABNDthwLhAwW9/RsYLycFVOi5Noiv+IXx27yRs8eUSdgGaKxfB8R23ngaKH/PqrZ8lJNQ6R 9ePe6xJjb4tTUU3t+lG6dkKRzUY807bOvyZTKXnhLW3aUs/I1dIypFanY/UXsqTYDgOywDJq/6yvJ N1sff/pAd8zrpF3ZwiEg/aEuU8Ut52/unlb60rMNUnsrNW244g0s+Gu9QrlcreQNSkCk9MBU2Lh/9 OTA5WhHbUX6umVUx2LU3Lj5XaLVnIzTzdUpGwJ/scnTnn3dpddgzSKrSlrvsOitHPs3kOdBAu4eHH mFJh2ODw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXqv9-000EvW-TX; Tue, 05 Oct 2021 20:20:24 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 67BE0981AAA; Tue, 5 Oct 2021 22:20:15 +0200 (CEST) Date: Tue, 5 Oct 2021 22:20:15 +0200 From: Peter Zijlstra To: Kajol Jain Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, mingo@redhat.com, acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, linux-perf-users@vger.kernel.org, maddy@linux.ibm.com, atrajeev@linux.vnet.ibm.com, rnsastry@linux.ibm.com, yao.jin@linux.intel.com, ast@kernel.org, daniel@iogearbox.net, songliubraving@fb.com, kan.liang@linux.intel.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, paulus@samba.org Subject: Re: [PATCH 2/4] perf: Add mem_hops field in perf_mem_data_src structure Message-ID: <20211005202015.GC174703@worktop.programming.kicks-ass.net> References: <20211005091837.250044-1-kjain@linux.ibm.com> <20211005091837.250044-2-kjain@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211005091837.250044-2-kjain@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 05, 2021 at 02:48:35PM +0530, Kajol Jain wrote: > Going forward, future generation systems can have more hierarchy > within the chip/package level but currently we don't have any data source > encoding field in perf, which can be used to represent this level of data. > > Add a new field called 'mem_hops' in the perf_mem_data_src structure > which can be used to represent intra-chip/package or inter-chip/off-package > details. This field is of size 3 bits where PERF_MEM_HOPS_{NA, 0..6} value > can be used to present different hop levels data. > > Also add corresponding macros to define mem_hop field values > and shift value. > > Currently we define macro for HOPS_0 which corresponds > to data coming from another core but same chip. > > For ex: Encodings for mem_hops fields with L2 cache: > > L2 - local L2 > L2 | REMOTE | HOPS_0 - remote core, same chip L2 Can we do s/chip/node/ ? Hops are something NUMA related, while chips come in a bag or something :-) > +/* hop level */ > +#define PERF_MEM_HOPS_0 0x01 /* remote core, same chip */ > +/* 2-7 available */ > +#define PERF_MEM_HOPS_SHIFT 43