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 81AF6C5B552 for ; Mon, 9 Jun 2025 09:27:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BF4F6B0093; Mon, 9 Jun 2025 05:27:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 170626B00A7; Mon, 9 Jun 2025 05:27:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AD426B00A8; Mon, 9 Jun 2025 05:27:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id DDBEF6B0093 for ; Mon, 9 Jun 2025 05:27:42 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 614A6101A5B for ; Mon, 9 Jun 2025 09:27:42 +0000 (UTC) X-FDA: 83535334764.07.4D762FE Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf20.hostedemail.com (Postfix) with ESMTP id 9FCB51C0002 for ; Mon, 9 Jun 2025 09:27:40 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf20.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749461261; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=cK2j777cnaxXBti4lkzIOlhE/fKnF3rLuqH45kppVuU=; b=Y3f/Wb5WMkPA69CSN0CkGMMG/Ut8h1V84AoLaac44xV+VJBynhFvnTtwC4ALkrFGwj7x2j 8UBPcOhlPdgDn8mAxtpLsELf3AWQ19nS98Bt/71CrlSSCu7q7GobxNkLvj76LwCM4AHPT2 5Q41GZCYcoUUlwxKEdgJmVkprnmFimQ= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf20.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749461261; a=rsa-sha256; cv=none; b=C7I4bQIawEH/tuiZ0T6/Hxj/YJa/I08YlKoP5klCPutBNVw0woANuW0WHVBPMP7lg6kEt5 pwVE3sIWkRRQHbCank3Bmcu72jHkVF75XpY4PljAvma0gSS70ROB5IQG2DfErZA5kZpoXo N+U9FdFuAtCaqGlhwLmHRwVJX4OvttY= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ACCF1150C; Mon, 9 Jun 2025 02:27:20 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 490FA3F59E; Mon, 9 Jun 2025 02:27:37 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , "Matthew Wilcox (Oracle)" , Alexander Viro , Christian Brauner , Jan Kara , David Hildenbrand , Dave Chinner , Catalin Marinas , Will Deacon , Kalesh Singh , Zi Yan Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v5 0/5] Readahead tweaks for larger folios Date: Mon, 9 Jun 2025 10:27:22 +0100 Message-ID: <20250609092729.274960-1-ryan.roberts@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 9FCB51C0002 X-Rspamd-Server: rspam09 X-Stat-Signature: i5wcc3nzo9n4bywqn5na66gk6kius7p8 X-HE-Tag: 1749461260-803679 X-HE-Meta: U2FsdGVkX1+icYsYzkWhcaZNBJhRo1kWTeMtEhe2fLerx5P6BzWXXzQfp5IFaLwxVF3/WXTx7pdIOPY3M4Qputakg90Q1UN36pzuR6YHX24VhabZRL7bJY3xzYfIFaULzySksAngB7pQrKIYN+74hJ/mjTKTY8KMDEn+1xQTEqq7a4YLb36NIyH1q3GumHRQsY7XB7DL356/5IvjeCdi/dntZZH6jSwUYfen6ysXOKhjMTbuk3srOsVodrOwCTwuYEtxXcut1UZWx1ec0WP1yVfygxEdFopOqx0TMpojTHwsFmsNQjupwX1KIrjQjVLsPzus7A18wm1FM9RfEi2vvv+uERTXlWWUoJbVoRafYopz1Ta2gr20LOrPVFCPyTjvijzTpHuP0rpiqXDeCH5XmngOPRjoDeMiAgUboiGTCQfeWNrzL9ubAl+Dxf7Iwm+aqzC0GZUn9xnkmstMxDQBa8uiO1Bx3SNgTosGuQCOEfSzBVoOW9mS9FT/k8osEKKZ1WYzb8edjWp+vdzA74rcRePKT6QeopDINZcutiAd6Iq29HSKpAiod5wOkAWPPWs3WiYvaG7HzjB1InCBVbWAs+/3fFp+bQbXIuk5+pc6ME/e6ihtxJL9wTUTRKNUQRe4XB3nWW97UG1eHaEI+1Jw+h7wGn7A30IIRzoeNdBw4VMYecjxL0TAYtOIBohRTCXUO2dqSzGZxPiXRfbRaoD8vDgYKJekdYvjR+WQD/zUPCkBLVToZvaFswGHBLQIXi9mXQJ89jZj0f/l9xfdn8GGwHJH6HnRJHfGYni/HyaASST7WHoYYmknUSS+3zczVQMxBtF/WY1+PS6OwpkNTq4rSRme+J6ZXKfEzjpEo0sOgIZAfPCpvEAlAXB0v54yPsoSrVNZw6wA4upg659LaZeFPbTHxu2YJgcu5MP3RdugxeiAFxdcNznfB3VtYbwLsCdTVgH7Ai21eXMWuwGi7bA cC0cX3dP wAn/O7SLRdbh0BX8GEnuASSBIcq9hb8yufxht3P5wIk7AzpB7HNr1nRTSUdkc2JDq8GQzvyZposr7FAps50GaGDByWtItiW8/v0ETNF4rf8BhEVz0A6Czd8VyknNQyhWntckEHBXUqAS+mRTfKoDo4B763q1vgKj9k6RzrJOd+Iw/JoZYCrhkMo/LDA== 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: Hi All, This series adds some tweaks to readahead so that it does a better job of ramping up folio sizes as readahead extends further into the file. And it additionally special-cases executable mappings to allow the arch to request a preferred folio size for text. Originally the series focussed on the latter part only (large folios for text). See [3]. But after discussion with Matthew Wilcox, v4 switched to additionally fix some of the unintended behaviours in how a folio size is selected in general before special-casing for text. As a result patches 1-4 make folio size selection behave more sanely, then patch 5 introduces large folios for text. Patch 5 depends on patch 1, but does not depend on patches 2-4. --- I've run a number of benchmarks and observed no regressions. mm selftests also shows no regressions vs mm-unstable. Selected benchmark results are presented in the commit log for the final patch. Most patches have R-b/A-b now so would be good to get into linux-next for some soak testing when possible. Applies on top of today's mm-unstable (a32230de8810). Changes since v4 [4] ==================== - Added R-b/A-b (thanks all!) - Patch 1: - Removed ra->size fallback check in page_cache_ra_order() (Pankaj) - Patch 2: - Modify ra end alignment to handle non-power-of-2 optimal ra sizes (Jan) - Patch 4: - Only reset order to 0 if fallback is due to not supporting large folios (Jan) - Patch 5: - Ignore VM_RAND_READ for VM_EXEC mappings in favour of following the new VM_EXEC code path since code is always random (Will) Changes since v3 [3] ==================== - Added patchs 1-4 to do better job of ramping up folio order - In patch 5: - Confine readahead blocks to vma boundaries (per Kalesh) - Rename arch_exec_folio_order() to exec_folio_order() (per Matthew) - exec_folio_order() now returns unsigned int and defaults to order-0 (per Matthew) - readahead size is honoured (including when disabled) Changes since v2 [2] ==================== - Rename arch_wants_exec_folio_order() to arch_exec_folio_order() (per Andrew) - Fixed some typos (per Andrew) Changes since v1 [1] ==================== - Remove "void" from arch_wants_exec_folio_order() macro args list [1] https://lore.kernel.org/linux-mm/20240111154106.3692206-1-ryan.roberts@arm.com/ [2] https://lore.kernel.org/all/20240215154059.2863126-1-ryan.roberts@arm.com/ [3] https://lore.kernel.org/linux-mm/20250327160700.1147155-1-ryan.roberts@arm.com/ [4] https://lore.kernel.org/linux-mm/20250430145920.3748738-1-ryan.roberts@arm.com/ Thanks, Ryan Ryan Roberts (5): mm/readahead: Honour new_order in page_cache_ra_order() mm/readahead: Terminate async readahead on natural boundary mm/readahead: Make space in struct file_ra_state mm/readahead: Store folio order in struct file_ra_state mm/filemap: Allow arch to request folio size for exec memory arch/arm64/include/asm/pgtable.h | 8 +++++ include/linux/fs.h | 4 ++- include/linux/pgtable.h | 11 ++++++ mm/filemap.c | 62 ++++++++++++++++++++++++-------- mm/internal.h | 3 +- mm/readahead.c | 36 ++++++++++--------- 6 files changed, 89 insertions(+), 35 deletions(-) -- 2.43.0