Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp332446rdb; Mon, 18 Sep 2023 17:22:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErtJJuWQu94OAYOMrFSkuJPHK7ykHaTx8spjE40urbdjgaCYrxnCmcqjreilo9nOf0vjqr X-Received: by 2002:a17:90b:951:b0:276:6be8:8bfe with SMTP id dw17-20020a17090b095100b002766be88bfemr1279034pjb.23.1695082937045; Mon, 18 Sep 2023 17:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695082937; cv=none; d=google.com; s=arc-20160816; b=KWey3rJBqIg0c68zqsqCYnU6Gk7cC5gdh51lENCQTE+jHFOL4k/7gy0xvMOi1eZLLo wGQ0lqCg4DtP8sWoZhAhOYMVbjOgahdPU38OHplX++rgyZCYMdKvba5Iesfc+UVpJt+7 9C2r7Px3On146VEt7ni+zKH74apOceGck4n4LFY0Iqp1nNsh+lFX+oKe7NdJOyvXRarI Rveny031baOP91myJQJdf+Kdc5ya/kGpzgOCRHjGZkjEP4fAp1nG0DbcIF3nj/SyE7zA j0cSY59myPNakOjiIpvb/0KzDgiBkPHtJXPMiHg1TQuXJGaY9+g92Mvp0wVzbRlFqAz1 sOGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PSl3YIBcOMlI28KGljTBp5+6rpOLjzI4VlDZcO+V47g=; fh=sp7sBsZTUf9rXqNOLzJE/lgZCTn3jJhl8tztR7PyMWg=; b=XgcvomSHsAh8IsWUxerQnKogLnmm65xYn99CQ2ybvKxshgoK0ji4pRZOylO0GSYI5t nRAfCECsPlvzvZE7aBXE4ncMy+EBCMshSxNsD6yr/A2kW4UlDgfmvQp2D63tivyrTLXT 9VMhlk6TAt6pJQwYCzIVtLg7Ad17xOqBt8XoOeiEMeJ0AXf05ToPe9HhuvxJTM4r0z/j oDhlrcvD7jk17WS3prOpmlzVSbseEiMYgnqJMOgKpHf4WkMJugr0IINncFIU5mn0Pzcu oYpY4Cd6PhTzgsXf+yfSFKesqeONHFeWBmJUfawt2Nhj1iZFqLFyNrfkPctFyL5LIVRa icGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=v51lvSCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h3-20020a17090ac38300b00274c70feb29si4768652pjt.162.2023.09.18.17.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 17:22:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=v51lvSCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A445C81BFAA4; Mon, 18 Sep 2023 11:09:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbjIRSJK (ORCPT + 99 others); Mon, 18 Sep 2023 14:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjIRSJK (ORCPT ); Mon, 18 Sep 2023 14:09:10 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8533FFD; Mon, 18 Sep 2023 11:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PSl3YIBcOMlI28KGljTBp5+6rpOLjzI4VlDZcO+V47g=; b=v51lvSCHJ27MH9SVEXRHAJB7qA w2bmT2C1j4sY40YT0/lBFqUnUQofZY/n9WBhFCJUODtoIRh1Yhi6dOTCfiid1DAA5T9ItyXXUffq4 69/1uJ9eBsRomdm0UojreSlngN5GpIIKlXYZaHSmiyDSTmmkIMIiiVlFRkStsGO2zmdKi1zUQ1h2X UXxxarA3pXN01KQqteWffiqwvCtCnZZm4fyutmKct5sD9jNukJltAcKA6UGwwL/ZKljZR3P/wzI82 KePlKSnNqxk7hiuBh+qjfn0mBcRw3fv4ieCqpCkY0JMkZM3bhv4I4UYRAZW/TlYeyKnXA6lPMOB0B 2/05ZOPw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qiIg8-00G33u-1d; Mon, 18 Sep 2023 18:09:00 +0000 Date: Mon, 18 Sep 2023 11:09:00 -0700 From: Luis Chamberlain To: Matthew Wilcox Cc: Daniel Gomez , "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "gost.dev@samsung.com" , Pankaj Raghav Subject: Re: [PATCH 1/6] filemap: make the folio order calculation shareable Message-ID: References: <20230915095042.1320180-1-da.gomez@samsung.com> <20230915095042.1320180-2-da.gomez@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 11:09:16 -0700 (PDT) On Fri, Sep 15, 2023 at 02:40:07PM +0100, Matthew Wilcox wrote: > On Fri, Sep 15, 2023 at 09:51:23AM +0000, Daniel Gomez wrote: > > To make the code that clamps the folio order in the __filemap_get_folio > > routine reusable to others, move and merge it to the fgf_set_order > > new subroutine (mapping_size_order), so when mapping the size at a > > given index, the order calculated is already valid and ready to be > > used when order is retrieved from fgp_flags with FGF_GET_ORDER. > > > > Signed-off-by: Daniel Gomez > > --- > > fs/iomap/buffered-io.c | 6 ++++-- > > include/linux/pagemap.h | 42 ++++++++++++++++++++++++++++++++++++----- > > mm/filemap.c | 8 -------- > > 3 files changed, 41 insertions(+), 15 deletions(-) > > That seems like a lot of extra code to add in order to avoid copying > six lines of code and one comment into the shmem code. > > It's not wrong, but it seems like a bad tradeoff to me. The suggestion to merge came from me, mostly based on later observations that in the future we may want to extend this with a min order to ensure the index is aligned the the order. This check would only be useful for buffred IO for iomap, readahead. It has me wondering if buffer-heads support for large order folios come around would we a similar check there? So Willy, you would know better if and when a shared piece of code would be best with all these things in mind. Luis