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 E1477C27C4F for ; Wed, 26 Jun 2024 13:58:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 739406B008A; Wed, 26 Jun 2024 09:58:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E9CF6B0098; Wed, 26 Jun 2024 09:58:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B1006B0099; Wed, 26 Jun 2024 09:58:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3D0786B008A for ; Wed, 26 Jun 2024 09:58:18 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E7C28C11A6 for ; Wed, 26 Jun 2024 13:58:17 +0000 (UTC) X-FDA: 82273194234.05.36A45E9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf20.hostedemail.com (Postfix) with ESMTP id 3C2751C0007 for ; Wed, 26 Jun 2024 13:58:16 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of "SRS0=QD5f=N4=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=QD5f=N4=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719410288; a=rsa-sha256; cv=none; b=yQ2CSEgAv8rSxcH100OzCuIiyVMpCkVbNe/NhAOu7NcJa/Dfmf6LZ5YuKo/zSgfXwJV6P6 8QeseWY36WWzLKUoNDKTqlDfELE2HWEQW2492xfSuZO9Qf6tOvjzabAzf6bxTnKjQld0lh UmNT6P+pHeVG7tfeMYfQGBHcD9O32wo= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of "SRS0=QD5f=N4=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=QD5f=N4=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719410288; 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; bh=GBRd1ekAfb6sq7rZlCQPgD9vnHUkG+k+WWKSZT24yW8=; b=SWC9croYTc3UXIwbzSaNMRPlOH5+NM8hWuZ8lvAHQ30dzGmoB6PnSRScXUgt8VwnhxYGba 61FKr1OOVT94kRsETLenTh3V7lbgUd9px6ekKnq0fCCAP0j5EcvWb8qp4SG1kh9c1eg+Fd RmvAnYfop2zh65+cMlj6VkLmhnFFNfU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 41E7E61A27; Wed, 26 Jun 2024 13:58:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB36EC116B1; Wed, 26 Jun 2024 13:58:13 +0000 (UTC) Date: Wed, 26 Jun 2024 09:58:12 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Takaya Saeki , Matthew Wilcox , Andrew Morton , Mathieu Desnoyers , Junichi Uekawa , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] filemap: add trace events for get_pages, map_pages, and fault Message-ID: <20240626095812.2c5ffb72@rorschach.local.home> In-Reply-To: <20240626213157.e2d1b916bcb28d97620043d1@kernel.org> References: <20240620161903.3176859-1-takayas@chromium.org> <20240626213157.e2d1b916bcb28d97620043d1@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: wc1wr9ymqja4hi9rdsne9pb19k3rxhox X-Rspamd-Queue-Id: 3C2751C0007 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1719410296-249784 X-HE-Meta: U2FsdGVkX19iM6QvjTAE5J0lvtAPN6miqo4J2I8ihnUun3OmQr7g5hjyWWmsjDp/BBehlLUs6/FpszGnPGSv6yNkLBuiXEzhFO9AIL1ChMaPZ6IGdHEJeblqJt7jtp6QYdH0bGHAN/C5fDqpu+IK/X/VoNn4hv0i6ByjrCnEMkYgoPJFHgLIPOINYwKq7tJjfG9dgUD21il+1ewqSCXpgE90opAMQ9HKuodCR2aPFZQfpw/ISB859gFlD9IIJwKEYGKgz0BEbfBL53FlzmeqwRDxAg7DeOhIhnC5wUC/s7NYxcQSjR5jSv1gw9w9kbxkxd0ZH4UR8OWS7QrHzoO9Gl0nnrFqX74eT0C8OVGntHUzcuCRZ0RE/imtyZC0iUs7jwV2hAvYpKtKOcMQg1NvW42uHk4Plw3hVXciQGxYQ4up8npLI8XxSn3verESLbxRkSHhoBl28WMr+TodNrHisTgeHqneSuWyXCWEHXtZ/GgDGtwfD9hWvcPctUFT3WYlv3nTxt1mmlLfLIAuFU1hIq+gr6HFuuvRvoZIvYG71Q3J+d3sq1wTa3Fo/6xz8kFZb+6HPuKwgUHyQlKNnZo9r0CskgG07DAi3dXzF8vO+lv6qxoecqozl6Vy3okvKIF7ogz8+/+zbA91V4hX53es6JeYjyVWxW0lFINlDewol/n/jUHh3NrXVuhdarRbHDP/e5f0wbyd6vRqGoYyO7GDREWZpvB2bbT6J0lf3c1ADHxRtGyUl/wTfwgDTXQOLofkhoo75JyEik1IqhMLqZBLpWyEWP1b2BpjPL1I6d5R2pr3hwreLg68hzqiUlb/GgTwTrEXdHA9xD1Se296nuEEbr9du1GhiwGHtlv9JtywcpQPVkmevD/j/3prWc2v2+xyxcH2dLD4IoF/YicchFTROSfNUMjrz+7fLlER6AF7iLx8roucS+Bh+njS3POiM3T7ZZvA6Iw8CSUOOan6Y0+ knrx0MXm OEr6WzOUfdixj8MLN6vgysYYzSPjNQlaaO/Ou3cor9AN7yQ5U2YipgPnlpngKm6EGj7k9nkqdiX9NZOsLIYSSBfMhGxMEH01cTtryCQV6usz+mKcv/kwFwWDpokWgHdeROklokk7MjPfzU2VCkmJMRe3uqpV1t6Ch3If+v2TtQ/CCi58eGtFpvcBO/o6sp5lIiLTuLHscEQ1MAgyE9MzkxsUUM6cx/LWjcKhy3pH9lXHr4tCVboN1p+Vch7zelObuDwEkSyaXB2OVUFoX0m5FdbqsbiTSdSITxnXHI0ZVBGLtq5qHrbPQ8WQTrUAp6yJiN1NixSBdoxP41W2Wm9HZc7Ze/IWJ+IYQ+wt0SXimGTTk6lAVlEFlH9EieBpEoJbEIOU5fcGqRQPcVEOLbeDQSx6Ev3+JtcfoW3Hv5o0fxEXLy0uqsKmzG04RJCB0Buv3ZIsa8aVErt5IWwjujamHE53fgWyejAeah/t0 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 Wed, 26 Jun 2024 21:31:57 +0900 Masami Hiramatsu (Google) wrote: > On Thu, 20 Jun 2024 16:19:03 +0000 > Takaya Saeki wrote: > > > To allow precise tracking of page caches accessed, add new tracepoints > > that trigger when a process actually accesses them. > > > > The ureadahead program used by ChromeOS traces the disk access of > > programs as they start up at boot up. It uses mincore(2) or the > > 'mm_filemap_add_to_page_cache' trace event to accomplish this. It stores > > this information in a "pack" file and on subsequent boots, it will read > > the pack file and call readahead(2) on the information so that disk > > storage can be loaded into RAM before the applications actually need it. > > > > A problem we see is that due to the kernel's readahead algorithm that > > can aggressively pull in more data than needed (to try and accomplish > > the same goal) and this data is also recorded. The end result is that > > the pack file contains a lot of pages on disk that are never actually > > used. Calling readahead(2) on these unused pages can slow down the > > system boot up times. > > > > To solve this, add 3 new trace events, get_pages, map_pages, and fault. > > These will be used to trace the pages are not only pulled in from disk, > > but are actually used by the application. Only those pages will be > > stored in the pack file, and this helps out the performance of boot up. > > > > With the combination of these 3 new trace events and > > mm_filemap_add_to_page_cache, we observed a reduction in the pack file > > by 7.3% - 20% on ChromeOS varying by device. > > > > This looks good to me from the trace-event point of view. > > Reviewed-by: Masami Hiramatsu (Google) I added my reviewed-by on the last patch, you could have added it on this one as it didn't change as much. But anyway, here it is again: Reviewed-by: Steven Rostedt (Google) -- Steve