Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4745830rdb; Fri, 15 Sep 2023 10:58:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2xrW16/q18nI3YZZl6KoAFr8y45tZmfujaR2WCVpPEpXZv80Jq9aleH/hUggM8RFMdpAa X-Received: by 2002:a05:6a00:2283:b0:68a:5773:6319 with SMTP id f3-20020a056a00228300b0068a57736319mr2702894pfe.11.1694800710324; Fri, 15 Sep 2023 10:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694800710; cv=none; d=google.com; s=arc-20160816; b=HUldVPr/IggJ9iH51tl47kSk782eEPdJkaMUPkRRh89vSSNxTNKsmarEco5U5y6+su U9IK58neUHhh2KTWSrjwMiLl6CKjhu6MNp41B7e+okM0BWsCssj846Gq3hRI+nCK2XC2 R8/xfg1hkH/Cr2Ewu2fINHGuCpcN4TIQztJeYj2FxU9qX3Z4vDXBP98D8yCz7aSWJNLD PLLIpEOMjYSuklIIMwx3rRGmdiJnvsaFjuBbet/aEZBLd+/PrmXmIkovaO+6vL0t6Fsq BAU9UmzKKK01JYvyOB70WYsSdxgC/aLQP7QSeuUNVJ6V/ETfoyF4/MVIc76Q6yMPVW1B un7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I+/YKQ4i+/r6yo756aOfG+7UGEVhIuZROLbZ9WTDM80=; fh=ardmABoZqyzAm25ow9fvqe18o8v8L1P0+Wo2I9sPHpg=; b=GPg+N2mW9RIMxqxI+3dBUSge98IGwlqGml8qzR/r/As0QI/AUyfodp2AtdNkoHe8hV 5SBbogAgz7TfkTuk+1iEP9UPrhwbHgukbljW2ToUe++1WV76Bk97202VmSBpdCnYihCY xLUccB0GYEMwtpwDwlleD9Duiqk9YAi3vmb2bhTKfMMzvIrCSqQJrVE60fewJCJUhLrS /FUEYLflvADCL2KE46SbQUdWaPUPWidDFncwlGNRIrTj0qWh9dUNzw19d49v7EFmRIGF FNZDnYZJKnv3Uv8pREOBSXiqDkuhK2OQbBlJ9iSChMebNauZ3xJ1zjQYF7uUK/CkZlHa GdWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Q4md8y4/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f21-20020a056a0022d500b0068fbbef790bsi3778812pfj.297.2023.09.15.10.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:58:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Q4md8y4/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1B76F8228981; Fri, 15 Sep 2023 06:40:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235403AbjIONk0 (ORCPT + 99 others); Fri, 15 Sep 2023 09:40:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235250AbjIONkY (ORCPT ); Fri, 15 Sep 2023 09:40:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 431651BEB; Fri, 15 Sep 2023 06:40:18 -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=I+/YKQ4i+/r6yo756aOfG+7UGEVhIuZROLbZ9WTDM80=; b=Q4md8y4/PXXCS6tFFXDCy+1Czx d1uDYKzf8x3eeThB0v0clHgFcJllTbJ/w+dM5rjEDs5ESW0hubWUmOtTW/Y73skTLMG0JAo4hZSDE lv5TM8HdRzUdIQ1Q85nKx+zVtMEPNzscnYBZzmYj+Y07Z8jMeCbtvzO01G5iekEMJtwyI/0Hb+nI4 c4HqyL1w0pNyrxMo/8iQRiyG7Q+lUiCtDZQxtNcGxf8IGUjO35cUCFccj3Syt8iKHPNYnULskYB6I A40s8+3gs8SVNvuf20h5Lvs0o91dLEKLPp0AkFXpGkL26fO9eKxcZFBEnOVEs5LV0rYcrr0WtNK0S mkSA6d3A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qh93H-009z79-Vc; Fri, 15 Sep 2023 13:40:08 +0000 Date: Fri, 15 Sep 2023 14:40:07 +0100 From: Matthew Wilcox To: Daniel Gomez Cc: "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.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: <20230915095042.1320180-2-da.gomez@samsung.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 06:40:37 -0700 (PDT) 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.