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 946C1EB64DC for ; Thu, 20 Jul 2023 05:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbjGTFeq (ORCPT ); Thu, 20 Jul 2023 01:34:46 -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 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.