Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp107991rdb; Thu, 21 Dec 2023 04:22:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IECOFKnAGImctF6Wvn5NXO6wOXCspYBRtTTiCIudzuOjzc/mwQBoKkcqiDOf5kKaxQqJRN3 X-Received: by 2002:a05:6e02:164a:b0:35f:c742:f35c with SMTP id v10-20020a056e02164a00b0035fc742f35cmr3918966ilu.102.1703161369382; Thu, 21 Dec 2023 04:22:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703161369; cv=none; d=google.com; s=arc-20160816; b=ZwkCF60qvzbdQSjyDM8fqC4BnQmuHT1vQ5QW8PYOiw52DmiXWkv69eNUJq3dVnqwoW vRi3ws+JEWyI2lchVeZq5WsQcFl6MTy3L6zW2LtdskXoblI7ev/vbfjldhJe/BiEzVfB MX+bbTF+6/BM46wRBRtNMmVSwSFM1T+/KIfYKMOLKlu3y3jzXE6sH0Y99AXQ4tVfcmw/ VP1LfrmOTg/QHWgs9cjw7rjbFZF13RHv33fTyWljj86VW16YTLQ7PZO6UDF4erlBOuyp sJc5PuNgop6ApWbI+1oUuvrcQX4yWRmahiz4WWUm8nXQ/z+RVNFIePYhyOnhEpxMjIl8 gCdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=yf0JQO7q/WuYj9NOYMc6EY3D63AVANrzc56xXJJHfLg=; fh=3T/uzv0xyCZLLhq6yN0VP/iWDb5rAjk7q7jsl6ANsZ0=; b=JPRZKnEUYMviPSaZtbbIc8ZX4zCmJOnoqPC3vchGAbZqGqp2Pv371FzCMDhpgd9x9t eJbLeBcbUkenubt+PirqffgKQ80POrt96a1qEsMerqN3+45ox5AI6nY+/LXJ9xV1p2XR 8DUsdLEjGmHmPAuH3++E5BcjB4ww3K2K4lh+4Y3vYeSasO8uOBxEQK5evr/X/f8NeYfF aB9vGDErfyLgT+pZZe359pbBeOFWXxDYPcfGqI7by8SWCvic3s/m+y84kYZc2KUqFyQb cWn53+ELULpAgK0cOG9UGLQSIRMyeDEPfVvykSIO8mc9ZkdxvVqn8x6OEsXT/m2Gwtvv JTqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8326-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8326-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h33-20020a63f921000000b005cd8b9dc455si1479795pgi.567.2023.12.21.04.22.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:22:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8326-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8326-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8326-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F2A4C285F8A for ; Thu, 21 Dec 2023 12:22:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAB516EB63; Thu, 21 Dec 2023 12:22:40 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 B25652206F; Thu, 21 Dec 2023 12:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 2393868B05; Thu, 21 Dec 2023 13:22:34 +0100 (CET) Date: Thu, 21 Dec 2023 13:22:33 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , 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: [PATCH 07/17] writeback: Factor writeback_get_batch() out of write_cache_pages() Message-ID: <20231221122233.GC17956@lst.de> References: <20231218153553.807799-1-hch@lst.de> <20231218153553.807799-8-hch@lst.de> <20231221111743.sppmjkyah3u4ao6g@quack3> 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: <20231221111743.sppmjkyah3u4ao6g@quack3> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Dec 21, 2023 at 12:17:43PM +0100, Jan Kara wrote: > > +static void writeback_get_batch(struct address_space *mapping, > > + struct writeback_control *wbc) > > +{ > > + folio_batch_release(&wbc->fbatch); > > + cond_resched(); > > I'd prefer to have cond_resched() explicitely in the writeback loop instead > of hidden here in writeback_get_batch() where it logically does not make > too much sense to me... Based on the final state after this series, where would you place it? (That beeing said there is a discussion underway on lkml to maybe kill cond_resched entirely as part of sorting out the preemption model mess, at that point this would become a moot point anyway) > > } else { > > - index = wbc->range_start >> PAGE_SHIFT; > > + wbc->index = wbc->range_start >> PAGE_SHIFT; > > end = wbc->range_end >> PAGE_SHIFT; > > } > > Maybe we should have: > end = wbc_end(wbc); > > when we have the helper? But I guess this gets cleaned up in later patches > anyway so whatever. Yeah, this end just goes away. I can convert it here, but that feels like pointless churn to me.