Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp103754rdh; Mon, 18 Dec 2023 13:01:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbovakuRlsTcBHuUuhWaaTFBZj6PHEwPTs82SzcLLbgzRmF5sq/C4yYsDBnVEBBx69Dfsv X-Received: by 2002:a17:906:57:b0:a23:7332:9258 with SMTP id 23-20020a170906005700b00a2373329258mr70612ejg.119.1702933270862; Mon, 18 Dec 2023 13:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702933270; cv=none; d=google.com; s=arc-20160816; b=WMzyMny8P669V7uEElSIhkU3BIMOmmWtJW/EHeAXf8TWMs6S+X6qDMDX9BEv67yidB cHXdPSx2+AqmmuYGDinF2n59Q/mts0WvD96vFbtHVq2ph9vFxaLUwHP/5bMJw7MZTkqK CDip7uk/pLRAhJcDLKq0t84sSXalqiMXxqYsV6eVutvdQjLQyZTzmwTkDuUwcgkedbh+ aSDjFTC2BOgj/1bAXKalkwuhtset85T7EUT/66HcOfxfRXytUo5T4SdBR5S2KUEfNvYR bdQjdzUEkZEM9uNkICRieHBiqY6C/zjL4HgMRi6WYyib8DC3bRIjjFT3dTMkrAviccsd rXJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yCl70P2eXwsD32MiqrmB1dJU3mIh1ffQIY/OsyTsmc0=; fh=i6rGHk/clC1f9Y4mpJyYVOWW6p98QflrI/jjeassMJc=; b=b+CBD7sR8EscreNtEvmg6gmFfxBXfEMFEqjuYObmq/0sxA7NlQNsMNj0hx1QqatdKs RSWWEHR9csrimy+6P79zgjQVkWSjOTJ87FAeahnEqYqixh+GhCK3RlWfvU2GMqk6CuuH YNRtOck7+pZAw+VtLasOefdPOIuDUtGXoPYzEtu3/ZcJjlqTGcxCO631B62hkl9PbrYY 1jHVk3cQRmz9FHgILlaRblZQsPxUvDviSDvhe9v6dCjGIOihZkqnxDq8hk2yh6wyHvip d/N8NIrKJI0SfGa8FRAlDpNVY8FsbPlG7POhM7fHuJCtoYH5M8QftpEev2opatMZUIxR M6gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=YIfzEHM+; spf=pass (google.com: domain of linux-kernel+bounces-4385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n8-20020a170906700800b00a22fb3af196si5303077ejj.881.2023.12.18.13.01.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:01:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=YIfzEHM+; spf=pass (google.com: domain of linux-kernel+bounces-4385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com 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 892DD1F22FDB for ; Mon, 18 Dec 2023 21:01:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75AC27348A; Mon, 18 Dec 2023 21:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="YIfzEHM+" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E9B11E4B7 for ; Mon, 18 Dec 2023 21:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-28659348677so2535544a91.0 for ; Mon, 18 Dec 2023 13:00:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1702933256; x=1703538056; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yCl70P2eXwsD32MiqrmB1dJU3mIh1ffQIY/OsyTsmc0=; b=YIfzEHM+joXJA0KroR1tlepEpaEEtwx3YNIoTwcAOssJtY2DBaMpSVe/99rJvzP1GW 4vhYsfIt5IUNmJkwZ254MtnQSKibPrA3lSAEpd8/capeZiA2R5SzsAAOlc93WtFzR+cF Sw6eCJ5xI487j2fqG8bJr+HDQwfdAJExTTqPOYhQZJYGSZbooJ3Ds0yAPIE1IbhaLgaT hQx4d08oswccFwYC/AF2LPUftZ45WyKsDH6xfO915PYOx9jED9tB5Fdm7/YjWxnZmMJF /3KxAhtJpbRlu8Y1NN2I3FYHD14lk7oEewD+HZGsPqXWK/iOB6U2fjAz6pvoZtpHBoQF ASjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702933256; x=1703538056; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yCl70P2eXwsD32MiqrmB1dJU3mIh1ffQIY/OsyTsmc0=; b=lu95sCE2pPg9yFWVlwPkWdyhTjKyPjASCpvfXuwtEK/BNSbkkgQa9CiDr57ozjRssI cWTwM3bO/zkxpl3RIJiJnz0tSRjZPU6uPEixuzKuIgMD56NPJJ0crm6plaMwROquXb6z 4r7EnOTYlomOpxX8buiqeDlVw9DWbA5hPFJD2NlQEtoopr/TQQ9ysUyaU3sqNtzL8c0W 5vayLJA70MjLC1UJU8UasmIjZzdhE7Xz63M7BtgtAH3gB0a/wZNBNC39Puxe7hSIZLO3 BJrw3JppDCbkvmlMgj5r5QOea+HaGBqX+9XFz1px8Exwkyl4n49ZB/P3w+IZVGkoWAZS bdjg== X-Gm-Message-State: AOJu0YxrQAfZkUghPMjO8+4iGEp1oUuLwgfgEJfdyZNBCkxdKER86zv/ CWdVDHCoSvr5N4cMM9gTcbqVHw== X-Received: by 2002:a17:90a:4b4f:b0:28b:5fc3:36c9 with SMTP id o15-20020a17090a4b4f00b0028b5fc336c9mr2440pjl.29.1702933256147; Mon, 18 Dec 2023 13:00:56 -0800 (PST) Received: from dread.disaster.area (pa49-180-125-5.pa.nsw.optusnet.com.au. [49.180.125.5]) by smtp.gmail.com with ESMTPSA id sh18-20020a17090b525200b00286e0c91d73sm20565584pjb.55.2023.12.18.13.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:00:55 -0800 (PST) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1rFKjM-00A8r7-12; Tue, 19 Dec 2023 08:00:52 +1100 Date: Tue, 19 Dec 2023 08:00:52 +1100 From: Dave Chinner To: Christoph Hellwig Cc: linux-mm@kvack.org, "Matthew Wilcox (Oracle)" , Jan Kara , David Howells , Brian Foster , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Convert write_cache_pages() to an iterator v3 Message-ID: References: <20231218153553.807799-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231218153553.807799-1-hch@lst.de> On Mon, Dec 18, 2023 at 04:35:36PM +0100, Christoph Hellwig wrote: > Hi all, > > this is basically a evolution of the series Matthew Wilcox originally > set in June. Based on comments from Jan a Brian this now actually > untangles some of the more confusing conditional in the writeback code > before refactoring it into the iterator. Because of that all the > later patches need a fair amount of rebasing and I've not carried any > reviewed-by over. > > 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 | 19 ++ > mm/page-writeback.c | 333 +++++++++++++++++++++++++--------------------- > 3 files changed, 220 insertions(+), 150 deletions(-) I've just done a quick scan of the code - nothing stands out to me as problematic, and I like how much cleaner the result is. Acked-by: Dave Chinner -- Dave Chinner david@fromorbit.com