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 6B0F4C021AA for ; Tue, 18 Feb 2025 15:02:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0812828013D; Tue, 18 Feb 2025 10:02:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0323F28013C; Tue, 18 Feb 2025 10:02:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E148528013D; Tue, 18 Feb 2025 10:02:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BD49728013C for ; Tue, 18 Feb 2025 10:02:55 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 172E31A1C46 for ; Tue, 18 Feb 2025 15:02:55 +0000 (UTC) X-FDA: 83133382710.14.47E2030 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf10.hostedemail.com (Postfix) with ESMTP id 5648FC002C for ; Tue, 18 Feb 2025 15:02:46 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="TH/vyPra"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Nldm3Xuo; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="TH/vyPra"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Nldm3Xuo; spf=pass (imf10.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739890967; 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:dkim-signature; bh=Q7AVrF9ImZMiQtbhCkV0xB4O3QN1TooCyYbbebiN5RI=; b=iTMsQ42CejNb7B6V4VrTqFWw3qaA8jh3MxDQ08tik/5ZXaaft/OTBUcxnTh8XE9sRoSOdB U5pt/8Y82HGArrm3iifXhgx1Gh5LbI9J5vhfMBCcVJH3LdYe7//mwlgsZVYN0IPD5i3XpE ERpNBTKMzIpuEP2d9chB8IRMPluePBs= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="TH/vyPra"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Nldm3Xuo; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="TH/vyPra"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Nldm3Xuo; spf=pass (imf10.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739890967; a=rsa-sha256; cv=none; b=hv2NVsLeU9ANUPsERBBi3jB6XL/HmgPu9wF+gQAJRu5lrzGXe6fJZ3cO0g9OcFtI+oZsgh ZLwSr+CiRH/WR4kV2BfCdKoQaLJxvN9VXmkTsDz8QbQZ6iJiTMgFYozXrtR6VAvQmDZyTL +B9FiRKGCyBYM/I5zQZVl339Wnk6Pvs= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 1F17C2116B; Tue, 18 Feb 2025 15:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1739890965; h=from:from:reply-to: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=Q7AVrF9ImZMiQtbhCkV0xB4O3QN1TooCyYbbebiN5RI=; b=TH/vyPrak8PCZ0vEaafDeUCYqouDLsldQujzwmjRx3pncH4F+TfCo0qIdTUz/i63MgyJkd yYJkSPZ+3qTwpRyn8foRLIryqazTTXhlct/kV8DVYnQTbXAjjLmYLRQANzrMPFXlPn8ipE x1FsKbfCHoxdiWRuXkLnaUXiStaj1PE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1739890965; h=from:from:reply-to: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=Q7AVrF9ImZMiQtbhCkV0xB4O3QN1TooCyYbbebiN5RI=; b=Nldm3XuoIBkSbhWanlQuhz9oeF7EWCcg8C3TA/s98xFav/thw1DTYEhF1FPrjvWZc4CcWW 3XirSQkS1Cp3XiAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1739890965; h=from:from:reply-to: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=Q7AVrF9ImZMiQtbhCkV0xB4O3QN1TooCyYbbebiN5RI=; b=TH/vyPrak8PCZ0vEaafDeUCYqouDLsldQujzwmjRx3pncH4F+TfCo0qIdTUz/i63MgyJkd yYJkSPZ+3qTwpRyn8foRLIryqazTTXhlct/kV8DVYnQTbXAjjLmYLRQANzrMPFXlPn8ipE x1FsKbfCHoxdiWRuXkLnaUXiStaj1PE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1739890965; h=from:from:reply-to: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=Q7AVrF9ImZMiQtbhCkV0xB4O3QN1TooCyYbbebiN5RI=; b=Nldm3XuoIBkSbhWanlQuhz9oeF7EWCcg8C3TA/s98xFav/thw1DTYEhF1FPrjvWZc4CcWW 3XirSQkS1Cp3XiAQ== 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 C5B0613A1D; Tue, 18 Feb 2025 15:02:43 +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 wpbBKxOhtGc6bgAAD6G6ig (envelope-from ); Tue, 18 Feb 2025 15:02:43 +0000 Message-ID: Date: Tue, 18 Feb 2025 16:02:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/8] fs/mpage: use blocks_per_folio instead of blocks_per_page To: Matthew Wilcox , Luis Chamberlain Cc: dave@stgolabs.net, david@fromorbit.com, djwong@kernel.org, kbusch@kernel.org, john.g.garry@oracle.com, hch@lst.de, ritesh.list@gmail.com, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, gost.dev@samsung.com, p.raghav@samsung.com, da.gomez@samsung.com, kernel@pankajraghav.com References: <20250204231209.429356-1-mcgrof@kernel.org> <20250204231209.429356-5-mcgrof@kernel.org> Content-Language: en-US From: Hannes Reinecke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5648FC002C X-Stat-Signature: s5od5i6gzw4ph4qj5cbbhekf3kdmcg9h X-HE-Tag: 1739890966-614332 X-HE-Meta: U2FsdGVkX18hp2jbZucyuqbUwtuf9PlvewZsrpZcax4EE9GGDFlDaOtxrw8G5xaghvJ/rsCFOXWP0wIEfJYyR54eUpzKeGc4dAlTVDaoNZa7TYm9RFoIXgVxXhyGad/p6ZX/ONNg0KdWIVtjwtqobFNi5bcXxRtZY81s3yCLwnBs4dzV9YCWMzDp2xmAjAXYfpXdr+OcDCt3fenOeoNoReYhGTiypCxKxVPIRH9iTrdoP05XOaPZyyIyJkyZaTpKYYYL53doPLUdplOMoVhz6rj0pbBhFsfzBo43KD+91jsz4VPMLsXEqrt6sbygxPkZ6AmupfnRC/ACvh0Ahmhp1o4OK0slCHKNEWpM9dlqsi9sFqticNfEiC9eyK33MoYsERKX7TERLj49w37XMNrKUm19r1Ugh71zs3e1sb5Z8MWfgzjax0kzBbsX32sZqU4CsKeu8/U/jLwzARNoHkMrBgwwEGTnRsGyqUuWKDd/uPwP6VWBf7jEvpHo3AMDGthjXnShpwUsJG2VdlOJChYh3kACV5ojJ5Wl8XVlTKWc3Yiq89HaHm8PbXsI2qy48y5Nc+R4AZLQ9cZFH6hQGfQBdzTUNgHgq9iS6YtE+zDTiqvDqAcpJsJrja7jFCGfXigCkdORCw3ccvfjO8+1qDb623ocZZZ/sFNuoZZwe0PNn6GvPNtoUJAsz5EP9fT25UeWT5/hTku9IiZCrNW1rWBLCy/iQN6AykWqZSLs1FN4frgHGcoVR6pjIUdh92gLfQ7/NwJyzVRYWCmKhFHL0rGXitvViO9DhchTCdiK1WA8BZG5FRr6tH1rrKrXDKT+xJKinWgYGJ/vEzfoZVVhy9RLEfN/FFEJg5M9jSY82oqbLfMUAlzLmFynhoL5KIoWNQz8aQY1H4KoLZyfxdBBY1ddtP/jkSSlxNR/kyPn0x8v9GRUQn9vgXFk5y4FqpWqHYKKE1Z4uqXC9ZaN/41jbfj R7K5Cjj9 37Kf/8Fp2BSlGy/7JoTATpUwWHpL2EphJCRAKS1n2pyFgzotRIzfSkhRUcK9pzuBGibNEjmL61C1FUYJj0nK+yTYOzpXrWv2MWPbrpNmW3yJrJhIHb2bQy4ciN+sNNad/jA9xmuDobxa/evIYqi4pzg5OgAYngaWB0mSPGZ1RN4DfVn8lRXHC6NVHTQRY9hK+e/1gUXs1Hj9DU3jNU7MZqF28P7bII9H9KNlyQAUuZAw7dof3jBpJ9faufTOeWG5vyZ4iRhs+7iGFsVQChG13roQO/tUnevn9vV1zeM1+ZNa2hfq6OkVlbcIw8Me4WWov3Pq7x/bceaaF6vjQuYD3QQezaFLF6FeW+zNUZGlrSml/LumNULGe261oT3DN3iMXpQe/QNAf5TNNBpsi+9FZZAKtI5HDuDA9XDYC+xu1cDvAVBcjw+KzMoi0KVzIXw0fjZoHL5tHU8Jrv+o= 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 2/17/25 22:58, Matthew Wilcox wrote: > On Tue, Feb 04, 2025 at 03:12:05PM -0800, Luis Chamberlain wrote: >> @@ -182,7 +182,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) >> goto confused; >> >> block_in_file = folio_pos(folio) >> blkbits; >> - last_block = block_in_file + args->nr_pages * blocks_per_page; >> + last_block = block_in_file + args->nr_pages * blocks_per_folio; > > In mpage_readahead(), we set args->nr_pages to the nunber of pages (not > folios) being requested. In mpage_read_folio() we currently set it to > 1. So this is going to read too far ahead for readahead if using large > folios. > > I think we need to make nr_pages continue to mean nr_pages. Or we pass > in nr_bytes or nr_blocks. > I had been pondering this, too, while developing the patch. The idea I had here was to change counting by pages over to counting by folios, as then the logic is essentially unchanged. Not a big fan of 'nr_pages', as then the question really is how much data we should read at the end of the day. So I'd rather go with 'nr_blocks' to avoid any confusion. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich