Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp276128rdb; Wed, 14 Feb 2024 22:37:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXHY7W0bimT/qqGI3L8hgiF5xO/kkb9IErNqy25vjbiFC9CVpThZFh9GN7/o4DWs0BgWcp7r3T1ZbM+Z8ElmOfsQoEkHd5C/+Me+lp41w== X-Google-Smtp-Source: AGHT+IGLCn8jYVbQSLVN05dbtL+hVvsudbDk+rB2I4ZHkJGQwK1l/WurY8NgJedLm/122/5iX2ug X-Received: by 2002:a19:7503:0:b0:511:9eb6:a79f with SMTP id y3-20020a197503000000b005119eb6a79fmr747978lfe.18.1707979045171; Wed, 14 Feb 2024 22:37:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707979045; cv=pass; d=google.com; s=arc-20160816; b=WK/42u3b1+rtejLc6bdLC0BnsyQ3kkIo4HOalbbv7s82XZRT61tpUnxd/C+THTBgHc E/NmR+E/tr0IxL21zrbRvmWZZrgn1l8vSBwnKUSrP0viOuZOZQlsNa+1XAFn3BlUBfJh p/es0lVZ9sm0Q3c8bjhZVkPDEsDP/CNy3c2PpKk8m8mDAtuFrkcc529PR9EcqM+StaNd 8cN+TfEi5NcgTb+7LfV/1U1j0fbHqMLetN1neOVouZp8ac6QsZBBoL7k4aUdv+rSQjEw KxM8H1Lcx4uPqFWmdm8REcCuBHm2jg7Z8mbhjlJfulLYq41d1Zgw34NZcyq1/WQoAeYz JNQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=UJh+PesZmsu6jGo4CJstKu5HORejXqiKtJp5m+bTSkE=; fh=Vrwx4bL9GhHO38K3+KQ84gkA1utqyQVh6nwEkKMM1oc=; b=zZQ2yTVCOlg4EedoKl3WRj2Qca9o2ztcERC4+KY1xggRzOZXQF7zpknD7tMjOjVEFP AanTllzXMf480UFED8QXQDLoFP3/yW5ek9wTzw8zfzFB/EiTqCvwRiYy9/wutvcsgDEZ 0CeeheURBRhX+7facmKhNrSMPV+jMbGjhZUdgtQ4wkuFPAFEBSWnGmiZt0DF5SnOycW5 kUnfXFRz8CDlv9FCpD9a9WqCxsfR1NC1rATag54HrRCU6tBIE9GyNXyhmqs80VEGWnkx KUvHpnFHM5uVjDn7lQ2iGAb+xoriXPvDylfDzfc1fjGWr/FZzfgx0D0Jdt2Bw4A3FDYZ Vz9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="q7MD1s/u"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-66324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66324-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id es18-20020a056402381200b00561659cf8e1si351082edb.658.2024.02.14.22.37.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 22:37:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="q7MD1s/u"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-66324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66324-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A03DE1F2A554 for ; Thu, 15 Feb 2024 06:37:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 577DBD53B; Thu, 15 Feb 2024 06:37:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="q7MD1s/u" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A8D1B67E; Thu, 15 Feb 2024 06:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707979026; cv=none; b=FqT2/fz4Bcjlo2uUvY9ohnN0qgR66kYGeuV5+5zOHH/qd/dRG6Nn+E0nz5tKyiKg+NZWt/206+v8TRngtKbUZq949kjT4xJXiJ7KuY06fnHBg4IXKn5CfXi2EddkSQ6xZnTD/20+FUaEXBUMxtk66WyFL63s5pNHxxiwvHepjUE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707979026; c=relaxed/simple; bh=jt9l7liAr8Tzw3htgWauiN648rS7CE21DZGkIgEDjQ4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=e3/qp1LcDUBqA+gy7nhhVwxmcWkNVBj40hb2Kae7VDmnixQqMk1eb79i0zTPYBIVXiawlPqxM/U3Eh2dtPeEDllaIi4azcpP0Lu+tENdSQ4s8CxMYXCsfhcyXINn56Dsh793MFU5lMcTcFpw7iljFPTZHI/4R2aXaoV/p37wgjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=q7MD1s/u; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org 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=UJh+PesZmsu6jGo4CJstKu5HORejXqiKtJp5m+bTSkE=; b=q7MD1s/u22UXzodFg16cvPL1LC 4mR8jjvKPzzb1WE2g3gE7ivDBDUKhA+tmRhfL29mt/JywbF+xBOXdBElDU8HcYqxnZRCHZ8Z/Q4Rs 4R6Vl+7bWIMLtzKxFcO8IMZH6eQDA8tW+yViHoo2Rje4cB41NmrIiGcJh9+InRSqYAuDUa1Vr+X8b ZBMaOFeqqOOGzE18C0H2urIKqIWuAxD0Dkn85zVNCNbjEamG0BG2IN9NDH9wRwIN3MaPtFGoc+HNU gPSqbkNZTxp7jLIrkRlSvatpbUg8NBNOqKLqgVTlSyRytp58dyUgdOoDGX61Va0+LVl4PIgiPE9IT nnOwbEnw==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1raVMh-0000000F6qz-2N9y; Thu, 15 Feb 2024 06:36:59 +0000 From: Christoph Hellwig To: linux-mm@kvack.org Cc: Matthew Wilcox , Jan Kara , David Howells , Brian Foster , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: convert write_cache_pages() to an iterator v8 Date: Thu, 15 Feb 2024 07:36:35 +0100 Message-Id: <20240215063649.2164017-1-hch@lst.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Hi all, this is an evolution of the series Matthew Wilcox originally sent in June 2023, which has changed quite a bit since and now has a while based iterator. Note that in this version two patches are so different from the previous version that I've not kept any Reviews or Acks for them, even if the final result look almost the same as the previous patches with the incremental patch on the list. Changes since v7: - drop the mapping_set_error removal in writepage_cb for now to get this series merged. I'll do a full audit of mapping_set_error. Changes since v6: - don't access folio->index after releasing the folio batch - add a new patch to fix a pre-existing bug where a positive value is passed to mapping_set_error Changes since v5: - completely reshuffle the series to directly prepare for the writeback_iter() style. - don't require *error to be initialized on first call - improve various comments - fix a bisection hazard where write_cache_pages don't return delayed error for a few commits - fix a whitespace error - drop the iomap patch again for now as the iomap map multiple blocks series isn't in mainline yet Changes since v4: - added back the (rebased) iomap conversion now that the conflict is in mainline - add a new patch to change the iterator Changes since v3: - various commit log spelling fixes - remove a statement from a commit log that isn't true any more with the changes in v3 - rename a function - merge two helpers Diffstat: include/linux/pagevec.h | 18 ++ include/linux/writeback.h | 12 + mm/page-writeback.c | 390 ++++++++++++++++++++++++++-------------------- 3 files changed, 250 insertions(+), 170 deletions(-)