Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2304227rdb; Sun, 11 Feb 2024 23:14:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU03wUvFwsGh3Cxv7HTeFYtDryq+YdG3m1QjxLZY9gkGRpul6N66FEGKzpAGirNeumtpBwtxl4vFsBqchBqA4+mUgJGx1SfMIhNlVQHiQ== X-Google-Smtp-Source: AGHT+IEuYGavPwuHxG1y1LTN+9tdJOehB7d+hjUGMWnlvTlTGJr0Ol/AJgW6ZFqLOWvoze4YLbJg X-Received: by 2002:a0c:cc81:0:b0:68c:8317:d360 with SMTP id f1-20020a0ccc81000000b0068c8317d360mr5862648qvl.36.1707722051917; Sun, 11 Feb 2024 23:14:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707722051; cv=pass; d=google.com; s=arc-20160816; b=Y1eVzJo6Wi/PQXaevFXEMFu26id7Q1vwj1ctol3Fe43qH4rHLJGlqD7RN6AI/QuyMg sZbZOYAfEgwUngD9vpD2g/HGPFMBcb0LzLog6F8tzC5OAwH2yMbsLwJKWzmZVJd5VRuF PW/qg0+BHS5+ihGu8KWZzgEfqVZeEX2jxWi1iRbpr0LTo81eFV3w5PF31c3NTgjnzXhL CqS9nK7/AddsMNhBQt8ZZBrlDCU1R43wW2hIAy+DbiKoPVOUps1bMp/KMLZCyg3u6pRy i8YQSsNzf3CNRRvuelKRmz4EG5WvXQ2bBfuZylyBT/SSlHT9zecFjprN9etA0jjC+jcd y99w== 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=F97bLYKX+BtaQqdKvZ6zCKr5tPLYltyO5pB8VnB7DyA=; fh=LpmLp39ngQO2Q8CfrVPUdBoqN2Uej5SVkVC1XNzsmGw=; b=LCvWdpG6MYsUT5W1SxS5Yxu5uyULGZ7t7MrxSwIr8Xxle7LP5DHS2LZF6P6RAZfvYU 8Zesxk1u7m4V2QhjF67mrJ6+5uVQlJSHwDjSId8KBaJyawTNbOeeicoPQtfhZdMFJPE+ u1NLsUvoq1dcSxbhN+Vj0gsFponzoQl6BrK0OyKglGYj4LNaii84hQPNNgLv6vGYG3Es sAodO4d1Lde4bNsUH9E0yL2IE9Vq4KfEsQjVQAjddwjIIzetItf3TmQ4BYqLBDhuo+U/ PEnuaxGpkIsc4zZaipYfkTmBAcYcVRcyHrIm9TKUzTLCWToT96dj/bBWabPRmf3pMkUA 022g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4aqPVakn; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-61126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61126-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWU4m+INVMnCcze7AVfeFzxuOmZRDDcnzh45lVpNEbD310McRC+ZzlsL8bjf3+sr2hDltxZWL/Qw5xuxezlVB0N7hk97LmsU4HDFgFwow== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kd10-20020a056214400a00b0068d0bf46fa7si2688552qvb.300.2024.02.11.23.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 23:14:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4aqPVakn; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-61126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61126-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AA0F21C20BCA for ; Mon, 12 Feb 2024 07:14:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18419748F; Mon, 12 Feb 2024 07:14:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="4aqPVakn" 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 AB85579F1; Mon, 12 Feb 2024 07:13:59 +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=1707722041; cv=none; b=LbaI2HOsZQnjo37L/J2zwJkKA6o1YGA8rHgW7L/3zNS6aoGtR3TG7gT4wP0GskbjjBMkefMoZ7ovDnNPUWEYKpqnQGs0WJA9f5tYSYM2LOckFWwOC00tYHn4DKS397tnYQmEKeqhqAmtcukhiZGid1iaAtiWXLh56fJ9a7GLQl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707722041; c=relaxed/simple; bh=aH+LQ+OWUJrSKdONb2E3wcTN0nj8/ltVMlR9ZqYEZzU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pWrm4gfz7SAt5Xs0iDA5CKlWewI1oUSqNIu9TchSi+dgekt/w1wzYHjMJa70sNexymXy86l3LOFQUcVOTZQ/hhPyP8aIUZcTGyre85lj/Ims9JhSuXl57EiCT+Ys4QhvhDu5x9aQ14CG71jlGmBSIZ8w55IiFAUd6qQ4Xa+upVU= 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=4aqPVakn; 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=F97bLYKX+BtaQqdKvZ6zCKr5tPLYltyO5pB8VnB7DyA=; b=4aqPVaknlyIJIU/z9Rj2PWIFIR gWqDxrfe5riQ85yrUwhbveTBuNTrirZObB9P/jMU7KtJMbKyYUBw6SNKsJqThxbUWHxEpkQxdlq5T yHVvpIkL34rbjQYM87m42lQmG7s0YeDzRLOse5XSIULK03Dmork+2CEUhoDf36pDaxjpm0AWVwG0Y Q7wwTmh3m18pwDpkodGLUxNCmk1d6CnoSPLx03FGnUHKtKw2rglu9qBDBfJjX66LSyjNDh43ur9ds Bzdx+PNRH6p8wrWY4E1MPXuTWnEZ++H+uSunR3UctYA8QJ/xRrhGBMiYUJ8XHfOkESLoaBY96PSqs VYA0UW+g==; Received: from [2001:4bb8:190:6eab:75e9:7295:a6e3:c35d] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZQVo-00000004Slf-2xag; Mon, 12 Feb 2024 07:13:57 +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 v7 Date: Mon, 12 Feb 2024 08:13:34 +0100 Message-Id: <20240212071348.1369918-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 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 | 389 ++++++++++++++++++++++++++-------------------- 3 files changed, 249 insertions(+), 170 deletions(-)