From patchwork Wed Mar 13 17:02:48 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: 13591603 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 CC7E3C54E66 for ; Wed, 13 Mar 2024 17:03:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C94E80048; Wed, 13 Mar 2024 13:03:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 97531940010; Wed, 13 Mar 2024 13:03:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CB9980048; Wed, 13 Mar 2024 13:03:29 -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 62D05940010 for ; Wed, 13 Mar 2024 13:03:29 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 308C4A0E0E for ; Wed, 13 Mar 2024 17:03:29 +0000 (UTC) X-FDA: 81892636938.09.DE68FA3 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by imf19.hostedemail.com (Postfix) with ESMTP id 803EF1A002B for ; Wed, 13 Mar 2024 17:03:27 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=xM9JIwoX; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf19.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=1710349407; 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=vHEsUd+FYkmqqyGjADf/C4ejcwO7DnLkDR82am0hB3M=; b=kBpM0peI9gpUrHKzVkcPriALdvEHMseX01WHFYlYXHUa4q200LUtAfUHdgJZYtYf22658q cmfAOtvyV8bYHTUZSa0QsMK9Nub4/jY2j5VJkUh9M0AZdnXAAoCkszCcpjzTWbcz6vanz4 urVYSZ5OrxQVx63vAyviLxHqUjDAeMY= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=xM9JIwoX; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf19.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=1710349407; a=rsa-sha256; cv=none; b=T9Oz3HlC2JAcf9OJ+gJOQkNh+TZeXrCr1A2dytyfN1y38gZK67cNeMTzoZbpkRiIGSwFSv ObxHl7ncYhUYKPhybgYF1Wv2c2mMvad+DvARD/tiBPSdbnEsYCIvjNjNk6y8cMRuMTWnfo B81db3GrRpJhgM3X0EIJ7ceWr+BRrTU= Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (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 4Tvxfh15bQz9sZ1; Wed, 13 Mar 2024 18:03:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1710349404; 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=vHEsUd+FYkmqqyGjADf/C4ejcwO7DnLkDR82am0hB3M=; b=xM9JIwoX5gfosfCIgrMHHI0lYvtdu6ZSdRS8udaibXJzPgqBiMrW7zluqYyjXMsntx79E6 2K2JqTPoFCW5ixCWR9tlqqjH1qKCyzUev3xHpZruPqOQHYPcZEKOxg8/ybdc4NAgczGzS4 7V9rgm9sX0lxn+RJdKbJpX7veZNi8RIO2ca6Eup7OaWjYAIdQZxeGzR8cRr5aDLlx9W379 0xvXMgN4k4w5usidPHXUIxwyv3at5dfBb6gkrUazd+wm7mrVE5lIkK4MCEp+J3yx8VzTUS r/b+/UPiq17+WJUtpABU496d59OseFcfLk7VMFEAyx72tw59+MsrrQajyD6jHQ== From: "Pankaj Raghav (Samsung)" To: willy@infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: gost.dev@samsung.com, chandan.babu@oracle.com, hare@suse.de, mcgrof@kernel.org, djwong@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@fromorbit.com, akpm@linux-foundation.org, Pankaj Raghav Subject: [PATCH v3 06/11] readahead: round up file_ra_state->ra_pages to mapping_min_nrpages Date: Wed, 13 Mar 2024 18:02:48 +0100 Message-ID: <20240313170253.2324812-7-kernel@pankajraghav.com> In-Reply-To: <20240313170253.2324812-1-kernel@pankajraghav.com> References: <20240313170253.2324812-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: hneciqbofxqitfegso3g7yuteaz7fj33 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 803EF1A002B X-HE-Tag: 1710349407-81382 X-HE-Meta: U2FsdGVkX1/W/6mHE8J1dJW/gu9f0O27PCyIgYKM3nw7xIql7KFdnWMjKdN/i8n7HXj+HSGwlXlNbH4FhfS3XcjJTfBh1P70PjJrDJEAnb/5d3dHVGMb75YdC4WBpcFKOpniasHYNqca3J41g5NMfFKpic6eWK2YEr90tdGrBf70Pp7+/jmeJpppRh/PlLREarkQv66IQIvVq2x8VbN4W8T5bAJIYglVstqvAzOHxpxOlOu4Luqw0t1iHTDKnJhsi1F/7LX3B5pvE4ReJJ9gi+EWHPGgjqsBEBnwQGH+DukZzY39Agiz5+YuGRJWlsjuG5guu9m14euyGOSnJHKxvfSzpvUbXYtct/J6Vkk8piw0gtwr80s5xXVYlfL/gLAkcf+NBa8/An6J8WeQ2BNlolb6MyLmDFUOE6hJbWs3PzQ3cufwohvIc5I50aUB66mgeSldeqeXpqfo8SeQiY10quM7L1OJosLG9Vk3IvVsIctd0YVt/8i4azSMyEv/oQZyhQoII2QInovDPK3qQCTEZB/qM4rZELN9FPO7gHg0gIO0rpa+T8kBwtAaZOIj2UB5yLOaXtNzf+9Rpr8+Vc9gmteGc0LBMJx1ENriVeDtx3//QA5eC1WasjGqgYMZuvW7XY59Clmjv18xg44EMEC2RA57SCBSx6EnYn3LXotwI1DKKcqrwwhqWtBXtYZikHP0/CIzNNYdIc042qxzviIPcnNjgiJCsUw8NQVydV/Gm7wYmzvX+q8NYUCo8EFNk2B6ljimZH92Q62JexuzcPiQMTz8hrNw3wXPTmcYwV64800vkZjmPegv3ZyBniTGfr9AU5hfrSbyRQzXvugjZYJh/ukhat7c5vjLbChXnMAcLEz5H9xklFrHl4M0XxvVViSCwUFYXzbNqNBRxozS1YFoWiGM53HCBj4SQO30EcEhjoXu+vXVTRzNy5WIxCZj3eeq5kn+fR4lkFQeShkUtaD Ws+kB28u 7DsjYqspEvqGXHeKB735qqlAgR3cqj5yVaBLP4eFNBO5nfuLzUHogzQD5CkUyDuFSKrYiDNj61FlnexiYtVPpg84ZCxIJZJL2Uohra2AIuLVs4B4XWmGeUCH36HfstLT0VrZ3JVMJA6nwkqQ= 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 650834c033f0..50194fddecf1 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);