From patchwork Tue Jun 25 10:18:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13710836 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 4419CC2BBCA for ; Tue, 25 Jun 2024 10:19:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 808216B02EB; Tue, 25 Jun 2024 06:19:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B0A06B02F2; Tue, 25 Jun 2024 06:19:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DE336B02EC; Tue, 25 Jun 2024 06:19:14 -0400 (EDT) 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 806106B02EC for ; Tue, 25 Jun 2024 06:19:14 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2BA0681630 for ; Tue, 25 Jun 2024 10:19:14 +0000 (UTC) X-FDA: 82269013428.01.92B717B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf06.hostedemail.com (Postfix) with ESMTP id EE59C18000E for ; Tue, 25 Jun 2024 10:19:11 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rE8i5kNl; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=oE0xVS7g; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rE8i5kNl; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=oE0xVS7g; dmarc=none; spf=pass (imf06.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719310740; a=rsa-sha256; cv=none; b=s8i2mAcbMUoV2r7226yhPVchmzzPc4WW+RDK4EpHrpZP8CRQ4cOdHEznhnGedAmTNTSXdM SkE57Jxbi2yddr5oo957eoh+h3VJ8qr0Xyr3C2v8nzAglXmSIoZoUn7KPAiL3/mGeGelQv 7IlF8UsKT8cergS7wcGfd1ZRk7iEZ7c= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rE8i5kNl; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=oE0xVS7g; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rE8i5kNl; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=oE0xVS7g; dmarc=none; spf=pass (imf06.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719310740; 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=etKpcm5t3yeZbDdRLHHmNy7tT/UIvSIL59H6KxFIGCA=; b=7CbZihrBCkXqP5RuHjEWlZ9xX6v46MuB7CVa9VkwVokJfrlTubHS3dSfa7Z1IbENY3dAX2 zENptIwt8KCPWQN6lRtNWVxxouqLSEhM0fq8ije1aC87jTQDwn2v7gbiRSVoZ8I0rxAGdP Phptz7cz4wBPTdSw2KhIfhT0SMsTy3I= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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 smtp-out1.suse.de (Postfix) with ESMTPS id 4939121A77; Tue, 25 Jun 2024 10:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1719310750; h=from:from:reply-to: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=etKpcm5t3yeZbDdRLHHmNy7tT/UIvSIL59H6KxFIGCA=; b=rE8i5kNlaX0AgnQkr/e+qACaK70IxSWR442e2gE7u2USV9HVMwpFh/GJUHTmURYCZpPp7c 5gcp6/4uKvF5q6CNkR/SjnYYU0+xssoRyh6N49PPqZv0xUHHiE1+DZtOHfFaCj2zgcevno ko1oz7YvBO+lLK5Ut/ijE2Xyom1qj/U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1719310750; h=from:from:reply-to: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=etKpcm5t3yeZbDdRLHHmNy7tT/UIvSIL59H6KxFIGCA=; b=oE0xVS7g8vkRXj4Bmf1lNIAQlt/gr3xGyg9YNceAg++iiya3vp1WPyoIWMJJhhBGJ1ukCy mcaWT/tJFiHYrIDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1719310750; h=from:from:reply-to: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=etKpcm5t3yeZbDdRLHHmNy7tT/UIvSIL59H6KxFIGCA=; b=rE8i5kNlaX0AgnQkr/e+qACaK70IxSWR442e2gE7u2USV9HVMwpFh/GJUHTmURYCZpPp7c 5gcp6/4uKvF5q6CNkR/SjnYYU0+xssoRyh6N49PPqZv0xUHHiE1+DZtOHfFaCj2zgcevno ko1oz7YvBO+lLK5Ut/ijE2Xyom1qj/U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1719310750; h=from:from:reply-to: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=etKpcm5t3yeZbDdRLHHmNy7tT/UIvSIL59H6KxFIGCA=; b=oE0xVS7g8vkRXj4Bmf1lNIAQlt/gr3xGyg9YNceAg++iiya3vp1WPyoIWMJJhhBGJ1ukCy mcaWT/tJFiHYrIDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3AEF613ADA; Tue, 25 Jun 2024 10:19:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0xxcDp6ZemZ0WQAAD6G6ig (envelope-from ); Tue, 25 Jun 2024 10:19:10 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id DE333A0936; Tue, 25 Jun 2024 12:19:09 +0200 (CEST) From: Jan Kara To: Cc: Andrew Morton , Matthew Wilcox , , Jan Kara Subject: [PATCH 04/10] readahead: Drop pointless index from force_page_cache_ra() Date: Tue, 25 Jun 2024 12:18:54 +0200 Message-Id: <20240625101909.12234-4-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240625100859.15507-1-jack@suse.cz> References: <20240625100859.15507-1-jack@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1537; i=jack@suse.cz; h=from:subject; bh=YMGuebUrm0qSfydyCid1z7UHFeUsV68V8mO59Irwxfg=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBmepmOHQLH0PwzfW3mfxx2sEkVan7MxcaVI6ZACKFq jkqSlruJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZnqZjgAKCRCcnaoHP2RA2eu4CA CqnwjdpuUvU0E8r6CCpeAHE+DzeV3rp7p0Z+WXReeccWJEVLIo9C6uoySJqZF6pzldz5Juuw+5Tq4d P4523q7ldw/oDZxNNKuSqei5MQeQHUHJqG86GHmZVOIb+WxSdlOaX0w4JwBZFI6weS+YMwQQ86Z+St ogUO3/Ev5niwgbxwUhqwA5OH5GtfBJw9su26AyzXPnUvuNyzVWajW6veMErhPUdp/RN4nuJC0sBGgR 5V49G5x3Z+LSQLkiRHS+Vmx/31fb4viCOg4+0zmfEIntH05yNwwPwQpn9HPdy+8KJ8xJFpJY1P+8/y nw+9is3leFpihkQHFjSyHEmm+7xmNo X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: EE59C18000E X-Stat-Signature: mj7oqnexmqxxrx1z6tnp64ho9qi764yn X-Rspam-User: X-HE-Tag: 1719310751-200934 X-HE-Meta: U2FsdGVkX1/bRC5zKz/jK0V2E3nzT7JYNUJHyZLA4gF/at2/k28QO+at6RKeKFjsDV0XnXUlC45AoGJDpvtmeY01YJEnclarq7bHPrF1sMYZUkWLItbFJ0qWB1pcREY2yoFXL1VDMsZdyx0yJMHfs3d+HrkDyiBNqspSkfD4gyc6+SGNUcmzqUGyngn9cvP1xVbeDh0KOY2YEMNrVtxmW/pVOmCwgjM3F0oA6ROKo9SIqaR+0Ag7sRVbnsWaUq6rNkxhw6O9wqMTdGKJQsgn+jqCCgAEEC6sGguRbMo5JIyPgC1Lesoww5S9UoWI4VW35suy9EqX2E+rtBFY2y4UVIziNv7/vBbgEmvsgXxdIq+n7Q91H2I8kMW3LFPG1c7Yz3jjChSOlSmljh8gIOqwfvlI6kyOKN3bQYrc012OoGBL/5ZhWNW4wLp26F8T0biBOpCUB211AS0Bbl/8GKqeJIpUbuaTD+FXQDXj4c7pEeIieg0oNu/6+XOz7eHI/0ZDIWKlIMhqPYwYDAHUh1HM6B490G7RSphQMLRUlGmPrMtjQgOKZGVsWUEIspYsGWCDm+mdCoXDRTyvBWceRuvASDkyTI8BEkzxLhCFwDZGORTkqg6CmU8Ydmm8wkfzeTA6pSodWeCSujPjWIg0zvCv1KZzuOCDdKFF5jbqVewjVk0IwQfZgG7RgtQUfk/Ukk6bUSH6mNs39CfnlBHMzssBbz+PnP1pictJK/3bXsTM/8KC64JXiLi7b404PdCrMlffp6UqoRqkd1E4Fa5vKpGY1L6+FGx21LgDlBA2oLicoP+eWTg6bDpBXnHs+7QNPMCIedVqfwyWdNGzflKYSjw7RHcAXulovu91JsDZC1g1giDI3tDqGMpcEOcFi9h4V/xW6hruuncIBtCP01g2eQTD3aVnw6eJQ1OohLd9ABW7BrUpdUEbooRml7RiK7leaybWFMFbS4Viz82/UMvzt7q pAA6DG9P OAP8if1vXtBXWTpK/w3x/X72GqRHjGNVL/UYoCdLNeqMXHklOn2Ss2jrO23CPFhPB81hOyW8BUG3HmlLUQcgwNDIOtH3Zpk4mI9Z2mwbnY/pPO3Rxt4WCwDlxfNHwFWNGCeGAYLaq6ZjEfvBm3NRXx6ue6TuTXIMsF/trCjGu3W12scPB2OV5WZqsgFxHvGeUVvPpsFZ7xKTJtYxzWIPjxB5MVqCj4V2twmLlrgQEKd7dFpJ0/a2cxacuAmVI8uBHO3zf 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: Current index to readahead is tracked in readahead_control and properly updated by page_cache_ra_unbounded() (read_pages() in fact). So there's no need to track the index separately in force_page_cache_ra(). Signed-off-by: Jan Kara --- mm/readahead.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index 1c58e0463be1..455edafebb07 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -313,7 +313,7 @@ void force_page_cache_ra(struct readahead_control *ractl, struct address_space *mapping = ractl->mapping; struct file_ra_state *ra = ractl->ra; struct backing_dev_info *bdi = inode_to_bdi(mapping->host); - unsigned long max_pages, index; + unsigned long max_pages; if (unlikely(!mapping->a_ops->read_folio && !mapping->a_ops->readahead)) return; @@ -322,7 +322,6 @@ void force_page_cache_ra(struct readahead_control *ractl, * If the request exceeds the readahead window, allow the read to * be up to the optimal hardware IO size */ - index = readahead_index(ractl); max_pages = max_t(unsigned long, bdi->io_pages, ra->ra_pages); nr_to_read = min_t(unsigned long, nr_to_read, max_pages); while (nr_to_read) { @@ -330,10 +329,8 @@ void force_page_cache_ra(struct readahead_control *ractl, if (this_chunk > nr_to_read) this_chunk = nr_to_read; - ractl->_index = index; do_page_cache_ra(ractl, this_chunk, 0); - index += this_chunk; nr_to_read -= this_chunk; } }