From patchwork Fri Mar 1 16:44:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13578743 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 D2D52C5478C for ; Fri, 1 Mar 2024 16:45:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5AACD6B008C; Fri, 1 Mar 2024 11:45:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 532626B0092; Fri, 1 Mar 2024 11:45:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3ADD26B0093; Fri, 1 Mar 2024 11:45:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1FA736B008C for ; Fri, 1 Mar 2024 11:45:11 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CEAD881450 for ; Fri, 1 Mar 2024 16:45:10 +0000 (UTC) X-FDA: 81849045180.22.A4E4F9D Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by imf18.hostedemail.com (Postfix) with ESMTP id 492A81C0028 for ; Fri, 1 Mar 2024 16:45:08 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=EhcDjdG9; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf18.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709311509; 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:in-reply-to:references:references:dkim-signature; bh=wBvRRAph/60/h4V+RTLg/hSlbvygSXk8WrjV0xu5/4g=; b=gpK4GTyYP8X0CkHDx7WbJxtxkHWKY0Lh0uRpw35qv9N50UvpM233/WbnrMYEoKSFq6+UYB WWdONOYU5PKXq07ZUjJScKrZLwu+tu5J3EotpR/XDgZdzmrcPCH8u8YBDsv8DSEog/LmeG OWrsdBQJHHdWRYJU9xf+ncxVe8YyTl8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=EhcDjdG9; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf18.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709311509; a=rsa-sha256; cv=none; b=n1qX591ByvKnchTnQ8s75XyWTqNuzM3+ST7YY+1Zdn4zr4SqQTQujyRADWzPw30f3AFioJ ALHz7A3dNXzYTIFsoIXJQGEnGtRocsWR+cq6E88qmuzLMnwyV6qFbt2Inuug5RTKqSch/8 cjV3fOTpOGUnja8UrhECY1yTrU3IMw0= Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4TmYq56x6Dz9t7g; Fri, 1 Mar 2024 17:45:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1709311506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wBvRRAph/60/h4V+RTLg/hSlbvygSXk8WrjV0xu5/4g=; b=EhcDjdG9qiZTG+V3uYtrOsPK0UUvzb17ipja6U+/IY0HDDnkY+HkPMp6p0u2+FSKecvqMu iWT8AtwgnLDakHtg95b2lJHGfk+s2XyJPWYikTnuC3BK/QjQRJMmqqOAPqBWr3IoSls4mW q19/nic1+DfHfZHR7JZTV1HpciObH2ScYT+9tgsK2vmAPUsIfP+bPAJRYxen4YAMvdN2kC SIAdF3SlBhG3Mqe/v2I/i2CCBekZQdagyrgkf3dcQFHgQZK6Na1PLH3v3csGAqLmSH04IG 9DZNFKUyvPqqe/5Ne7SHmLPq54ZL9V7gnXR0jla2EERn/u2BZBYnEczSx/YJzA== From: "Pankaj Raghav (Samsung)" To: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org Cc: djwong@kernel.org, mcgrof@kernel.org, linux-mm@kvack.org, hare@suse.de, david@fromorbit.com, akpm@linux-foundation.org, gost.dev@samsung.com, linux-kernel@vger.kernel.org, chandan.babu@oracle.com, willy@infradead.org, Pankaj Raghav Subject: [PATCH v2 05/13] readahead: round up file_ra_state->ra_pages to mapping_min_nrpages Date: Fri, 1 Mar 2024 17:44:36 +0100 Message-ID: <20240301164444.3799288-6-kernel@pankajraghav.com> In-Reply-To: <20240301164444.3799288-1-kernel@pankajraghav.com> References: <20240301164444.3799288-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 492A81C0028 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: e35gcn6igjoa64szctw4fx75xxe3t3hk X-HE-Tag: 1709311508-702781 X-HE-Meta: U2FsdGVkX1+E4CP3nv7X5fDDzUX+p2eu/l4YtgI2ftKS2IGomiWkHjep/XM17P8aWA19ZNO321Y10X/uVdSV4FD6SYmC5KTBnEnrfZGejLoqRgOKY7s1uvDsTz6f1JHfrRhJeLkhhVwDPYq+GhdO6lHl0FSfkWr/YVxH1swSON5p+/Q9SjBZsGtiPILcmA78sNxuJ9Gm1v08CVZjtMD1BYtu1yzDV6xdjtlkMG535iMHvr38DwJP6nwh6VWePqf9/OT/mRIkq+dQvEUc7Hoe0XOQmwVvuprU7zJdhTelXg/w/nhx78CKrPJbqQXkLb1sQY7X+D9E5LN4S24TurHQDLNx67W6xJRNm3VYJ1YtndcZYMn5GO0bKBGuWyc5scxvswolENwJw0cUb9lHI6Cq3PEOnS0EvIQFvf0h7+nGpgX8hJ6fjJPe8zMY3/0LGLZiVgQ+KN5GTea4SFgH6kxOC/DW5CdGNoYoP7LWt7vqAQRPX+yuKko6ByUuC525gNrUZIeDEwf0M6ropqgrbqVcncRyy+d6Dei0aLxxkAniG6AVoJDA+5WbXkOJj3HYngQebKgBJLUtTp6YgiWE5c1/eBXeQYrRuj66u5iEvIhICo2CHpLVl2xsv4AvVmF3WkkCwTo879iS+jhzXUk7BATAxWW8adDLpMPDnNBxm/Nq6rSdM4DSwRz+3GIfAF3K2aNWMiNci2moetENZrQVvdQIxH5yhX/657Zy8Q4Uh0S11Pyv7NJ6BNIXox8l9/1EVcvCu+3RnpeqgqbEjQGLMauA4eT3sJTVstRKF8+QXE6O73/yK1gdeuzZkTjfQz0m6lZ0Mh/DMIQp1qOqocO+7cbgR1/IizLUITlwae2plt0FjCT/GSDmHVuYktBqvMUe9MfH858GJEgDAw5mqL2isONyDEdRL43ZtZYMdqPxkp0XrMICFF1JzrR60NrHhFkPjJVep6zpqXX0UcHvhQEKhUX 0j7w1zO9 HSSJ2vCaP1dfo7LsDn5hiEPrI+F31tMryhc3zPNMl7r2oTayVB3mUAsJzgHUZAMoJJbJ9BISfQleEzHZh0F/fnN1GdyzoECanqEEUM6CFaBfWeI5QPsvuFn0rEf+2l8epLZTZiyDJ20OhSL0= 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: From: Luis Chamberlain As we will be adding multiples of mapping_min_nrpages to the page cache, initialize file_ra_state->ra_pages with bdi->ra_pages rounded up to the nearest mapping_min_nrpages. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- mm/readahead.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/readahead.c b/mm/readahead.c index 369c70e2be42..6336c1736cc9 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -138,7 +138,8 @@ void file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping) { - ra->ra_pages = inode_to_bdi(mapping->host)->ra_pages; + ra->ra_pages = round_up(inode_to_bdi(mapping->host)->ra_pages, + mapping_min_folio_nrpages(mapping)); ra->prev_pos = -1; } EXPORT_SYMBOL_GPL(file_ra_state_init);