Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5980954rdb; Thu, 14 Dec 2023 05:26:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGocjGhmSeTq/5Odavwnp771bTDpTYNkpLjsn/hRLZy4bBbMzFpx0n2EeW6apthjrX75xf8 X-Received: by 2002:a05:6870:15d5:b0:203:1a20:570a with SMTP id k21-20020a05687015d500b002031a20570amr3777712oad.74.1702560401577; Thu, 14 Dec 2023 05:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702560401; cv=none; d=google.com; s=arc-20160816; b=JSmlvviu1PaO44bf3v8Ea7+09C3HeE3WomrIeE7q82taFIR3wJvPlh1h1z6zcd3p+3 Xr32DKkK8ujuLJxE1ZprcD0ams/rhk1ax3YzK1DCE849SIV+gIXrMgon0q3rQppSdjTf k2bMEAxf9mfYxSi+20hfjqmukaYgllpATgmM27haC3Wnucwsl+Pp1Q9pD6doEjJh/tDV SnSoRtNQ9kATFcfDaW2dSK6EOdSQzDuZNxYh1aPyOWHSYrNILYpPubjxYpZO4Hq62QXv 6I1kkIJva3LvqOxTmbIdC35RdnGhfJJXB5QlxXpsXkfEcy9IxqbUSW7ld5PuQWm9zKTA 3hyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LREzFOiIV3fjDw34Jpih46a+FLwDl5jbzLHg7aSD75g=; fh=s6qbYcpKmY0AEsK/gKDpT3qiaGyyaU+hQ5h16uVwDEk=; b=HVeF8xNm8xfmRuP7CDURbLv0h5/gX1txarXwtoZZtkXnPD719Xchlb3wyiHll+zAW0 jEmMF7XeDN2UADLC9DsS1Q6BjaZHaeg2OctYf2C1wzTjuFdMWoHkK8YNDHDOSv/5XFGT A1RcyUvNdze12Y+IRKGcPajREghcQFuSr7rkvppNwuHUaVOhrjJ0zB2Q8PtNu3Q2IJVz ae12VjCTo4gxEomMhPRZqKfiMxTuVgetjaeqE5i+VHSsFCWrZMR8o1DNnO5tDzI5+RFc 4EVs7jzos0ADlBrgIV4to6o9y4NmB+1pzhcGQh3umdfzGYITiOR265EshK5fR4x/D1q4 xIXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=msTwUCdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id e12-20020a65688c000000b005be01a390b5si11000872pgt.472.2023.12.14.05.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:26:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=msTwUCdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 22FAE804EE69; Thu, 14 Dec 2023 05:26:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbjLNNZq (ORCPT + 99 others); Thu, 14 Dec 2023 08:25:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573302AbjLNNZo (ORCPT ); Thu, 14 Dec 2023 08:25:44 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AFA210F; Thu, 14 Dec 2023 05:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=LREzFOiIV3fjDw34Jpih46a+FLwDl5jbzLHg7aSD75g=; b=msTwUCdvMHb/A7UZZVc4eJcwh8 Rg0CdLaGQkHv71MLerQ3i16FSDMF/Ai6tyMaxiCaM5BEDwKP4Gqll992eRMuqwt71Jx8zumA+UG4O JcRee4RYP9MvyVu4ZEgNZ52P7eIGxvmrnZgzl5zQL79PU85dZ+JTD4ri0YY0nucSK6oyPoHGgBDHe Fi5FyVjmUg0asyhaG4lC3vY7TYdptWnvjCi3QFK+FR+q1HfAv8mZ19y8gi+rC/v4buCm9w4OEg1J1 W5R6hAHk/WC+auX7wcV5GzH24haPOpXdrd/Z3lxW80kvt9ULJoV0bolRfcORbOf69ppwCN5PwrrUe 3SpeRZiQ==; Received: from [88.128.88.27] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rDlil-000N0X-2K; Thu, 14 Dec 2023 13:25:48 +0000 From: Christoph Hellwig To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , David Howells Subject: Convert write_cache_pages() to an iterator v2 Date: Thu, 14 Dec 2023 14:25:33 +0100 Message-Id: <20231214132544.376574-1-hch@lst.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 14 Dec 2023 05:26:02 -0800 (PST) Hi all, this is basically a report of willy's series of the same name for June. I picked the lastest version from his (now apparently defunct) git tree, rebased it to mainline (no coflict, neither for linux-next), reordered the new fields in struct writeback_control to document what is interface vs internal, and temporarily dropped the iomap patch due to a conflict in the VFS tree. willy: let me know if me reposting it like this is fine, or if you want me to stop. I'd just really like to see it merged :) Note that patch 4 is missing your signoff, so we'd need that before proceeding anyway. The original cover letter is below: Dave Howells doesn't like the indirect function call imposed by write_cache_pages(), so refactor it into an iterator. I took the opportunity to add the ability to iterate a folio_batch without having an external variable. This is against next-20230623. If you try to apply it on top of a tree which doesn't include the pagevec removal series, IT WILL CRASH because it won't reinitialise folio_batch->i and the iteration will index out of bounds. I have a feeling the 'done' parameter could have a better name, but I can't think what it might be. Diffstat: include/linux/pagevec.h | 18 ++ include/linux/writeback.h | 24 +++ mm/page-writeback.c | 313 +++++++++++++++++++++++++--------------------- 3 files changed, 211 insertions(+), 144 deletions(-)