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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B552C001DE for ; Thu, 13 Jul 2023 14:42:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231132AbjGMOm0 (ORCPT ); Thu, 13 Jul 2023 10:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbjGMOmZ (ORCPT ); Thu, 13 Jul 2023 10:42:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A4922705; Thu, 13 Jul 2023 07:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qlBSNZe+0NvNZn+P5G748gKaiHgsz3ciqEGyUuZBWjY=; b=D0QNrR2P0oNIy7MaTXRI+ArkOC URsmfC9MHg39RcQQZVmyGDySTaD2Pj57LcxQmPM4seAF2bGHpenh6tA8IkLPJj3R3IoY4fWocGnyU dNChIBk9sqJRRwZkJeyD8RW+noZi6wbfPIjNVov6KwtDPB2dJZDRIn/ZTX52zf7wQFXGBz3bqD/KW NTeRLnwTh0d7OGY654VUO6DgmpsXTwshYlx4oDUP0kfDYVShY8TTfEghSJ4xrZBVlFDhvKnH+48dG H2MHBrXXp7Iq28BXSYYg66g18mcIPnXRPor94tD2a9Lc8CwC6a1C4LsGEJ4zm07j9x/+Qt8PJlMW3 QnmDEMcg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qJxWM-000EHP-W7; Thu, 13 Jul 2023 14:42:19 +0000 Date: Thu, 13 Jul 2023 15:42:18 +0100 From: Matthew Wilcox To: Kent Overstreet Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, Wang Yugui , Dave Chinner , Christoph Hellwig , "Darrick J . Wong" , Christoph Hellwig Subject: Re: [PATCH v4 7/9] filemap: Allow __filemap_get_folio to allocate large folios Message-ID: References: <20230710130253.3484695-1-willy@infradead.org> <20230710130253.3484695-8-willy@infradead.org> <20230713050439.ehtbvs3bugm6vvtb@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230713050439.ehtbvs3bugm6vvtb@moria.home.lan> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Jul 13, 2023 at 01:04:39AM -0400, Kent Overstreet wrote: > On Mon, Jul 10, 2023 at 02:02:51PM +0100, Matthew Wilcox (Oracle) wrote: > > Allow callers of __filemap_get_folio() to specify a preferred folio > > order in the FGP flags. This is only honoured in the FGP_CREATE path; > > if there is already a folio in the page cache that covers the index, > > we will return it, no matter what its order is. No create-around is > > attempted; we will only create folios which start at the specified index. > > Unmodified callers will continue to allocate order 0 folios. > > Why not just add an end_index parameter to filemap_get_folio()? I'm reluctant to add more parameters. Aside from the churn, every extra parameter makes the function that little bit harder to use. I like this encoding; users who don't know/care about it get the current default behaviour, and it's a simple addition to the users who do want to care. end_index is particularly tricky ... what if it's lower than index?