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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE78DC25B4F for ; Mon, 6 May 2024 19:16:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 684F26B0082; Mon, 6 May 2024 15:16:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 634246B0099; Mon, 6 May 2024 15:16:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 522FD6B0088; Mon, 6 May 2024 15:16:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 359A76B0099 for ; Mon, 6 May 2024 15:16:38 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DB1951C0EEC for ; Mon, 6 May 2024 19:16:37 +0000 (UTC) X-FDA: 82088927634.05.694CC32 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 2635816001D for ; Mon, 6 May 2024 19:16:35 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=p22adx8V; spf=pass (imf08.hostedemail.com: domain of acme@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=acme@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715022996; h=from:from:sender: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:dkim-signature; bh=FOiLuclMLCVOJU6VC9y2A35tnAyv+/gex3syTeIhZGw=; b=Dnx/7pNcTvlBlthTh1/Mab3VJZTw8WUn0SX6T9puyiQWDecF1ZhavbMKyu7tmPiSUhIhD5 W2h4Id3hui1FdcuiIEO4TkjKdH0EIdrjs438MdUCMiAOXynZD8AFGr+ipznFRl5ry9w5+7 TFAGA4XVYXkFUEvhiINGBV+ZLuPIX+c= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=p22adx8V; spf=pass (imf08.hostedemail.com: domain of acme@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=acme@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715022996; a=rsa-sha256; cv=none; b=lVEkPdRTelPaeepi2/3eYFuD3hD0Dh9xupLXQumWCf7Ypqn8d4I7tEpWsKlaAa3BuYJM3n B63zPbwyJyn5xFyHLc14BatdpqZ29kNHnWAPrNcx3RY3h/gFFFBE1utNIGu7Mz4wYxtKvs mTBFWQ4GXn8F8dAGHRFaO8UsrwUXcQE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2CCAD61423; Mon, 6 May 2024 19:16:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D687C116B1; Mon, 6 May 2024 19:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715022994; bh=dM4RYK1HPhpiphlZExp0kEMnb2WuO6EBZsOrpdKmkeI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p22adx8VFW7ioiNw8e/ZClDpQeoamqBgo/VwXvYdTwee3MTcDB2ZePDbNbjAvc4T5 NuGCLi+wL0GgrhzfHq6N9p0AFieqH32JaMVefOMxHrSdra4NOfhuWldsP15wD7WedX OoxyBdvnnMSyWkIrxg6rk0nv4igi/dCiaZeaQ+bQOQck7dkfETOlMAxrws+8WIhOOd nLYtWcMphLkM4rwdvbXR+Hmw03/ilUto8JVBQvKOp80RI7niKEEcz0NnYK2Z273oMa 6dcJGaWJf31fdI2kMmlRNFbgcogQyWoXU+k2xg8smolJCa7JAMdHFNTCHIBc3s26we lN3Uzt6mOpauw== Date: Mon, 6 May 2024 16:16:03 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Andrii Nakryiko , Jiri Olsa , Ian Rogers , Greg KH , Andrii Nakryiko , linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, Daniel =?iso-8859-1?Q?M=FCller?= , "linux-perf-use." Subject: Re: [PATCH 2/5] fs/procfs: implement efficient VMA querying API for /proc//maps Message-ID: References: <20240504003006.3303334-1-andrii@kernel.org> <20240504003006.3303334-3-andrii@kernel.org> <2024050439-janitor-scoff-be04@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Stat-Signature: r8x6o46hfo1mtx7xfyjtpxix4rwzfjw4 X-Rspamd-Queue-Id: 2635816001D X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1715022995-444214 X-HE-Meta: U2FsdGVkX1+xDCReNDcJILx11w6AuMNG2PNXhMzzsZh9DrkxEH8yTcJhZfnvA71GstzoKGGjunYMAtLfVmxhnVCIhXhGHx+k/e6FaDqC7HUe5ta+KK2zZPpION3KaYVFGfu64B56jBrL0484FSlfMNQ4pqXCFnEBUbMsLCtnpCzFN8BWB/X36JnYb57/G/tW/vtPpm6+Spxe68nHC5fGLFZYyFLp92mG+1xgLPHPuK/uLVrztCFjCMnD3jc3Ce7Li6bXEGz7xqaXTXIWJkGH1FcOFFcvY8MRxn3NgP/pvfwgLBpOKgJ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A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, May 06, 2024 at 03:53:40PM -0300, Arnaldo Carvalho de Melo wrote: > On Mon, May 06, 2024 at 11:05:17AM -0700, Namhyung Kim wrote: > > On Mon, May 6, 2024 at 6:58 AM Arnaldo Carvalho de Melo wrote: > > > On Sat, May 04, 2024 at 02:50:31PM -0700, Andrii Nakryiko wrote: > > > > On Sat, May 4, 2024 at 8:28 AM Greg KH wrote: > > > > > On Fri, May 03, 2024 at 05:30:03PM -0700, Andrii Nakryiko wrote: > > > > > > Note also, that fetching VMA name (e.g., backing file path, or special > > > > > > hard-coded or user-provided names) is optional just like build ID. If > > > > > > user sets vma_name_size to zero, kernel code won't attempt to retrieve > > > > > > it, saving resources. > > > > > > > Signed-off-by: Andrii Nakryiko > > > > > > Where is the userspace code that uses this new api you have created? > > > > > So I added a faithful comparison of existing /proc//maps vs new > > > > ioctl() API to solve a common problem (as described above) in patch > > > > #5. The plan is to put it in mentioned blazesym library at the very > > > > least. > > > > > > > > I'm sure perf would benefit from this as well (cc'ed Arnaldo and > > > > linux-perf-user), as they need to do stack symbolization as well. > > > I think the general use case in perf is different. This ioctl API is great > > for live tracing of a single (or a small number of) process(es). And > > yes, perf tools have those tracing use cases too. But I think the > > major use case of perf tools is system-wide profiling. > > > For system-wide profiling, you need to process samples of many > > different processes at a high frequency. Now perf record doesn't > > process them and just save it for offline processing (well, it does > > at the end to find out build-ID but it can be omitted). > > Since: > > Author: Jiri Olsa > Date: Mon Dec 14 11:54:49 2020 +0100 > 1ca6e80254141d26 ("perf tools: Store build id when available in PERF_RECORD_MMAP2 metadata events") > > We don't need to to process the events to find the build ids. I haven't > checked if we still do it to find out which DSOs had hits, but we > shouldn't need to do it for build-ids (unless they were not in memory > when the kernel tried to stash them in the PERF_RECORD_MMAP2, which I > haven't checked but IIRC is a possibility if that ELF part isn't in > memory at the time we want to copy it). > If we're still traversing it like that I guess we can have a knob and > make it the default to not do that and instead create the perf.data > build ID header table with all the build-ids we got from > PERF_RECORD_MMAP2, a (slightly) bigger perf.data file but no event > processing at the end of a 'perf record' session. But then we don't process the PERF_RECORD_MMAP2 in 'perf record', it just goes on directly to the perf.data file :-\ Humm, perhaps the sideband thread... - Arnaldo