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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C02BC07E95 for ; Tue, 20 Jul 2021 07:21:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A25EA61164 for ; Tue, 20 Jul 2021 07:21:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A25EA61164 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4C6418D0002; Tue, 20 Jul 2021 03:21:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4757C8D0001; Tue, 20 Jul 2021 03:21:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33E2D8D0002; Tue, 20 Jul 2021 03:21:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 108E18D0001 for ; Tue, 20 Jul 2021 03:21:40 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 99F5E1BCCA for ; Tue, 20 Jul 2021 07:21:38 +0000 (UTC) X-FDA: 78382121076.26.3C3C202 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 6D2F1E001810 for ; Tue, 20 Jul 2021 07:21:38 +0000 (UTC) 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=S44fEA8PhBtw3MXYTKBDeHZUQIviCFCTf/RdbSRDWZw=; b=clK5qvXwHzzWiyHuOVLO/6Wvfk whaNOohg2PsOYJsynI1r4aQisEQ1EqkKu3n3m6Yl/tiVQTxmsLg0/O++ey0Wi1P6asPInkhfdkOT0 EkrlCrYm6LvAk8mdnkghIBXO4JpfZeEEn+Y9wKOzIJ7Osh8vUIq/b865OEWDjRhNeczJb3B49tlDj mdLxXIwfJnFAKA1uOCNymPudbF7lkca8nq/QMJzZR87iVkKIHi8/EyM2dJ7IWNguusy2lbL3KCYoW vvOLy5RW2aUwEcNG5as5o6JmtlsuvjtPyiGOSfByRijROgEh1YqbAPpa5Jf5N1waPF3iTRY0DKTP9 TATPjFDg==; Received: from [2001:4bb8:193:7660:5612:5e3c:ba3d:2b3c] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5k3Y-007rjO-38; Tue, 20 Jul 2021 07:20:58 +0000 Date: Tue, 20 Jul 2021 09:20:43 +0200 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org Subject: Re: [PATCH v15 16/17] iomap: Convert iomap_add_to_ioend to take a folio Message-ID: References: <20210719184001.1750630-1-willy@infradead.org> <20210719184001.1750630-17-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210719184001.1750630-17-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=clK5qvXw; spf=none (imf30.hostedemail.com: domain of BATV@casper.srs.infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=BATV@casper.srs.infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6D2F1E001810 X-Stat-Signature: awtn3bmss8rd3taxqxcjnum7mg3ufyru X-HE-Tag: 1626765698-181897 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jul 19, 2021 at 07:40:00PM +0100, Matthew Wilcox (Oracle) wrote: > - merged = __bio_try_merge_page(wpc->ioend->io_bio, page, len, poff, > - &same_page); > if (iop) > atomic_add(len, &iop->write_bytes_pending); > - > - if (!merged) { > - if (bio_full(wpc->ioend->io_bio, len)) { > - wpc->ioend->io_bio = > - iomap_chain_bio(wpc->ioend->io_bio); > - } > - bio_add_page(wpc->ioend->io_bio, page, len, poff); > + if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) { > + wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio); > + bio_add_folio(wpc->ioend->io_bio, folio, len, poff); > } I actually have pretty similar changes for the red and write path to avoid __bio_try_merge_page in my queue. I'll send them out ASAP as I think such a change should be done separately from the folio switch. > /* > - * Walk through the page to find areas to write back. If we run off the > - * end of the current map or find the current map invalid, grab a new > - * one. > + * Walk through the folio to find areas to write back. If we > + * run off the end of the current map or find the current map > + * invalid, grab a new one. Why the reformatting? Otherwise this looks sane to me.