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 DAFEEC61DB3 for ; Thu, 12 Jan 2023 22:24:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C73B8E0003; Thu, 12 Jan 2023 17:24:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2776F8E0002; Thu, 12 Jan 2023 17:24:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18D428E0003; Thu, 12 Jan 2023 17:24:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0A3828E0002 for ; Thu, 12 Jan 2023 17:24:57 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C0546C06FD for ; Thu, 12 Jan 2023 22:24:56 +0000 (UTC) X-FDA: 80347578192.28.5722257 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 7B27C140012 for ; Thu, 12 Jan 2023 22:24:54 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GDlywwV1; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673562295; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fOcUK+hckQBKekKB+Kid3HNLQd9wt/xT+XSlkYF7VKI=; b=q7z/txQn0C2pwjjNl1OH5PirpDRBxS+ZO/u+ToOdm55CGDB2QCKUItcHNc0BhaejQhL0G6 iPP1nJT19X3gwLOhhmtxb4WrLJTrCVTL3y3rwZ8M5z5tprZLN2uXQHWgYeChMOze1a3s/t Sb+wvcyflKb0UXiU5zZK7EpnnMrLtJ4= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GDlywwV1; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673562295; a=rsa-sha256; cv=none; b=w7+DDoyQyyNtdMsJOtKXwg/hCGeAeLV5wmMcYVqu9qvUW8f/+8/VB3hdon3QU2i1Ru6bXN 3RqY1UX+Y5XBhgJOiD2cMSrlxuVwDvdW5C5KxkdgP1wt5sVWvCcgJQP0+Xuola0K7FuPHg vEEyGqvOKndtkL4GBk19JtyGqnB62no= 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=fOcUK+hckQBKekKB+Kid3HNLQd9wt/xT+XSlkYF7VKI=; b=GDlywwV1GBNQvOnFIcnvjP48pB cHAepTwoHNJDZraQ3T0wojAHGlYX61km9ZE7MeupEvDZhLgtxOk4ttEFNyiBhIpBJNy6V6W8xjJsj OefJqW1YAoyeNVW/1eBK9unN9dEUocmnNpfRNTJcqqj5/U8t9giwoA26Zk00Yesyp1QO2yN4zHSUX Pn0MZZlmvvdai0Odwcr6hmfipeD5bsMkYU+LxaAAqR6BnEuwRc3TRsGLJWpVv/yw/mTUeG039tbP7 5sEyIDbSmF1sKLnKWakPtYQWsAxcEmwI9gghuoF5ctj2TAV+SCXNj8NtatBxvXnTQtcrWbuGRofTt wKEm4a3A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG60D-005WuV-5U; Thu, 12 Jan 2023 22:24:53 +0000 Date: Thu, 12 Jan 2023 22:24:53 +0000 From: Matthew Wilcox To: Steven Rostedt Cc: lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, Joel Fernandes , Brian Norris , Ching-lin Yu Subject: Re: [LSF/MM/BPF TOPIC] tracing mapped pages for quicker boot performance Message-ID: References: <20230112132153.38d52708@gandalf.local.home> <20230112171759.70132384@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230112171759.70132384@gandalf.local.home> X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 7B27C140012 X-Stat-Signature: so1rhyoxdy81fhqozxy7c7ebxjyymmee X-HE-Tag: 1673562294-491251 X-HE-Meta: U2FsdGVkX18guAve2axGpWWviTVf8ohBmVwVrhlMlc/OUL9DTM6Bl+6bVVKGbFkJs4BydqYCsabkhacYeSIImrs/a0JcS3O/CfsWIyB4d68dDdSe4MEitAlBYqWeQiv5gDAhBjltVKCdUOC7ehe1JzpGJVJPXLbXCEMcpZruytQCMcgtnX8SlJRHnEs43fgLlSB/Ad8TYvj9FKhcWaZgD7JHCzJvgPsy7P2HSOSj/zIzgka7DlCVUU+JKmwm8Nhpb1rug8hDaILrVgujS5MIAVmb2VHFdt9yQFh0s6hO1n0z7FH1nNTsLW1nraPv56DWpgHSCzHoPZCUR0SK+xl7+RIgas08hc3+7/q+LW3v/vd+52gUlmHpzxfd7z6k4TmQp9DUY29iS0YSHPZKNcdD0EMvgzEL/rWuLe8ouvkreUNxMdJinFiF5PxXdH8nZ5pQZDScDipcXSAdTHS7lfiI9NPV1R3HPg29XdVEyizLhZJlv/ndQbLHe3KNTtMm0oJrfHVEi+0mOG1khAd+lD/UHzoscjawFlJ/+Zh3ilhayqiZpN0Sqpe2LisC97OtJnhCtqiIj2ZXXB8zUIc0nSDe6sEszkuS4toeqNoL2pw+YQDWDBm53MU+/lFvRKJfq3Gp0vDRqrQ8ZcLVGDzbEIBbkxjeAN/n0WcOw6Gv+OIC/VEZJo8abHPOGCm1gkJ5E5yJuEzTEkx2K262uHFb8+U0CXw0EXppyCGJqcKe/xKLPdHlsAERVPK2KnCi89tvRD9eey5xMqwOhQPMwy5fa4cSA9EVKs/2QvGOSSLBs8zaamYUQwWxw5EU98KIQbF1cG/JU4mh/hOvnwbI1DQjLaEutg+bhferQNf0 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: On Thu, Jan 12, 2023 at 05:17:59PM -0500, Steven Rostedt wrote: > On Thu, 12 Jan 2023 20:35:53 +0000 > Matthew Wilcox wrote: > > > On Thu, Jan 12, 2023 at 01:21:53PM -0500, Steven Rostedt wrote: > > > What I would like to discuss, is if there could be a way to add some sort > > > of trace events that can tell an application exactly what pages in a file > > > are being read from disk, where there is no such races. Then an application > > > would simply have to read this information and store it, and then it can > > > use this information later to call readahead() on these locations of the > > > file so that they are available when needed. > > > > trace_mm_filemap_add_to_page_cache()? > > Great! How do I translate this to files? Do I just do a full scan on the > entire device to find which file maps to an inode? And I'm guessing that > the ofs is the offset into the file? 'ofs' is, yes. That should have been called 'pos'. And as you know, inodes can have multiple names in the filesystem. I imagine you'd want to trace open() to see which names are being opened; you can fstat the fd to build the ino->name lookup. > (from a 5.10 modified kernel) > > <...>-177 [001] 13.166966: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a0 pfn=2586272 ofs=1204224 > <...>-177 [001] 13.166968: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a1 pfn=2586273 ofs=1208320 > <...>-177 [001] 13.166968: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a2 pfn=2586274 ofs=1212416 > <...>-177 [001] 13.166969: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a3 pfn=2586275 ofs=1216512 > <...>-177 [001] 13.166970: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a4 pfn=2586276 ofs=1220608 > <...>-177 [001] 13.166971: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a5 pfn=2586277 ofs=1224704 > <...>-177 [001] 13.166972: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a6 pfn=2586278 ofs=1228800 > <...>-177 [001] 13.166972: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a7 pfn=2586279 ofs=1232896 > <...>-177 [001] 13.166973: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a8 pfn=2586280 ofs=1236992 > <...>-177 [001] 13.166974: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776a9 pfn=2586281 ofs=1241088 > <...>-177 [001] 13.166979: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776aa pfn=2586282 ofs=1245184 > <...>-177 [001] 13.166980: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776ab pfn=2586283 ofs=1249280 > <...>-177 [001] 13.166981: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776ac pfn=2586284 ofs=1253376 > <...>-177 [001] 13.166981: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776ad pfn=2586285 ofs=1257472 > <...>-177 [001] 13.166982: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776ae pfn=2586286 ofs=1261568 > <...>-177 [001] 13.166983: mm_filemap_add_to_page_cache: dev 259:5 ino 9b11 page=0x2776af pfn=2586287 ofs=1265664 > > The dev 259:5 is the root partition. > > Doing the following: > > $ printf "%d\n" 0x9b11 > 39697 > > $ sudo find / -xdev -inum 39697 > /lib64/libc.so.6 > > I guess that's what I need to do. Thanks! > > I'll try it out. But I'd still like to have an invite as I have lots of > other fun stuff to talk to you all about (mm, fs, and BPF) ;-) Your topic doesn't have to get selected to receive an invite ;-)