Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9150165rwp; Wed, 19 Jul 2023 23:45:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFFWvCpTkRpZglxmoxi0qRRkUjgRReHkw58pODgSwnfs3NTQZaKK5aFWN8cEwp3WD/NvXMp X-Received: by 2002:a17:906:1054:b0:997:bb66:3ce with SMTP id j20-20020a170906105400b00997bb6603cemr4988925ejj.7.1689835557549; Wed, 19 Jul 2023 23:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689835557; cv=none; d=google.com; s=arc-20160816; b=keCEtfoSvhNnuwuZ2ycKj1l4TkkFyf0XUZGIk8LFJ40Yz/a+q+9Xvm62FLigYSnu/l 4DWCZB1pQUDabljwhZjH/NHe5UOsbvJDcPciejG6eUhRpOQGkKMiFO/3SzFAEOyfHikj 4AJ509jzFYSW+BDI1V4uYMvdZEr2jWdf9ryiEeqfcOOvFERrjtxx/tP3Ka+Ac5sXu08i v9FJtlJ8wgDqryP+YsPJ3CON1cBhBCvYHpkzJItoNuLNWbIkl9Ug2ap+EvphJsDqgADK zu/34ItehsEp8L5Vg1f+gjCR0DwplBB4480o/9FeftRFlk9PlFSGEsDFT5etFmaxpniX QG9A== 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=hFybdOvvnOfesblq0ygtn3MBu6SceidBPg+cvmISP3Q=; fh=x3WAL5A8qufJg7deTWwiANG0+ynfas6A/DiQ5jZyw+c=; b=H+xMeHrPFoOBykrUvUnHS1SQvWiKrCzNnY6TAz+cGFRkZS3H+AChxFep8idwD2WJiv s5uqsUpnl7kOW+CTyKTn51ZWDGNsyiGLKPX804nN9iAG2xn1n5rl/yYYpGyFI29XSnVE fFkDoCZ2dpVUgq+6lbW4J1571nOjlY+Lv6ZZx42pgsQQDeVwvc8rFLg++dTR4EO18z3F neBVCiLSCiHRGvMrFV51CA+leA7Wok7Z9UC9gsjk0lpVigEH0PvchP2Z0Ldexcancbzp Jl+Me3dcJl0mftdulHaPRjzsphvrKnpuPdr5mihOSlYxTwELz+8CausomfUSdA+u92IB kMeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=vGqIT386; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a1709064acb00b00997672cb9d7si226231ejt.411.2023.07.19.23.45.33; Wed, 19 Jul 2023 23:45:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=vGqIT386; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbjGTFep (ORCPT + 99 others); Thu, 20 Jul 2023 01:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGTFeo (ORCPT ); Thu, 20 Jul 2023 01:34:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99ECD1710 for ; Wed, 19 Jul 2023 22:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=hFybdOvvnOfesblq0ygtn3MBu6SceidBPg+cvmISP3Q=; b=vGqIT386WlC6G+dGehwmvQGZoA buFsz+rMXKRceZlZD+mTvjlQ5n5jQmUi2TdpTrSMYfguBM6aE8HAu7ApPiINW/WVjQXh5TecxAyyd mxTpquGrOiEFxshhsY1ht8BMVCX1YrMRebpbb1yM7nk8qH+0idECOxXnCO5qNHlw0s/R6hrnGngrH hWfBit/tIb2A9ZpkmyXQYvJRvsom0rJCryXYfeRg0Y71+p9BPvVCEMxVKFBWV0WgAHIHFWOFLk1jl qOzjTLdwPnQ9NGGv+jobG1LlwWe2+pVbE7He32UoQdy5ZpmT9/R2qzc9gy8HCsG1B7C4iDLsJISb0 WAX4G2fg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qMMJA-009pxE-18; Thu, 20 Jul 2023 05:34:36 +0000 Date: Wed, 19 Jul 2023 22:34:36 -0700 From: Christoph Hellwig To: Matthew Wilcox Cc: Peng Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, sidhartha.kumar@oracle.com, akpm@linux-foundation.org, wangkefeng.wang@huawei.com, sunnanyong@huawei.com Subject: Re: [PATCH v2 3/9] mm/page_io: convert bio_first_page_all() to bio_first_folio_all() Message-ID: References: <20230719095848.3422629-1-zhangpeng362@huawei.com> <20230719095848.3422629-4-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Wed, Jul 19, 2023 at 03:17:34PM +0100, Matthew Wilcox wrote: > On Wed, Jul 19, 2023 at 05:58:42PM +0800, Peng Zhang wrote: > > From: ZhangPeng > > > > Convert bio_first_page_all() to bio_first_folio_all() to return a > > folio, which makes it easier to use. > > This wasn't what I was suggesting. Indeed, this may introduce bugs. > I was suggesting adding bio_first_folio_all() so that it can be used > by code that knows this is what it wants. To add another opinion: I'd really like to see bio_first_page_all go away. The right way to iterate over the pages is an iterator. If we really want to micro-opimize not setting up an iteator because we know we have exactly one page/folio just stash it into bi_private.