From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9533AC7EE2D for ; Fri, 24 Feb 2023 16:12:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 127516B0071; Fri, 24 Feb 2023 11:12:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 089F46B0073; Fri, 24 Feb 2023 11:12:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6B446B0074; Fri, 24 Feb 2023 11:12:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D47606B0071 for ; Fri, 24 Feb 2023 11:12:09 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AAEAC140144 for ; Fri, 24 Feb 2023 16:12:09 +0000 (UTC) X-FDA: 80502677178.05.46C1116 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf05.hostedemail.com (Postfix) with ESMTP id 6F867100002 for ; Fri, 24 Feb 2023 16:12:06 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=AnRQkSq9; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677255127; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=De1mIGDznkep02AEOIOiRotwz93uXVDX1sI4fbfcfBc=; b=HHHHh+DpLhS/uhebPUykt2aQ4sYpERskOVq57FwlAxJ4qItBguYL6hTI8LvIyjpHCJupxh lOynFcph91xP38AwRd7tpUy5h4dzXsU8MLqweHQfP/NdzibTgSSL0EVcY0q+Feu99rbyFB IkRVeN2klj8Evl3fqkCoKAkU2HTqxOI= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=AnRQkSq9; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677255127; a=rsa-sha256; cv=none; b=IS8ScDF74bL1FMQAxrhGWc80HJc1lLZHbKwOGr65MvZ6bomyNk1duw9t7KfMT/NyYcgZe+ L9KgA9aaL77ML101fzbsL41VrCWaoXSUaHXWqEx8CMr8aV4xsTv4O4hpZKtQYCS82IMUEt 7j+PgPpBNilKaum9ALq3V9lIWpMc3uo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=De1mIGDznkep02AEOIOiRotwz93uXVDX1sI4fbfcfBc=; b=AnRQkSq945ElIXdLtal7DM5ZFa 9fdPM4pGJ0JDhE+se03gkJJWpcgLKNWcHWCIkpC/ZjENe7eUi5S3qkaZ7qPYWAkPuUfBfm2brXhuI 8hDLEvEKjUSiOUxb2eVDcWJk7vGDGwAdJD40/W0pMiu6n0o42hBXZ/cdFesYA3H/OwFKJN7l12t6O ZuIDoiJ8CIBA9plQNzya+jqt6mGypD+LtCcoi9iLB5gtdgKT52JJYyeBz6BZdARGRjOyAbz7hbF1T G6NxV0McjcppNjRpDpNSkx89C0sP1B8TFU4b54ybfE/eBlBWvnb19k4JD3QLPsIc+BG4ccDI3F3tY g/c7PhHw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pVafi-00FLuE-QW; Fri, 24 Feb 2023 16:11:46 +0000 Date: Fri, 24 Feb 2023 16:11:46 +0000 From: Matthew Wilcox To: David Howells Cc: Linus Torvalds , Steve French , Vishal Moola , Andrew Morton , Jan Kara , Paulo Alcantara , Huang Ying , Baolin Wang , Xin Hao , linux-mm@kvack.org, mm-commits@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH] cifs: Fix cifs_writepages_region() Message-ID: References: <2134430.1677240738@warthog.procyon.org.uk> <2009825.1677229488@warthog.procyon.org.uk> <20230220135225.91b0f28344c01d5306c31230@linux-foundation.org> <2213409.1677249075@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2213409.1677249075@warthog.procyon.org.uk> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6F867100002 X-Stat-Signature: s13mxfuk4g1goyzb5jk7fxchg7urb788 X-Rspam-User: X-HE-Tag: 1677255126-745956 X-HE-Meta: U2FsdGVkX18TuQ0IULPMwIimcLS/vRkUW7TZZ8ElcWKdL33D4Ujz/ByTjxqxrpchznw7/MfA+DeLMzU6K1ZKs5N9RNyS/zM+CEJZPUQB1bAG/qbVMxw3UUYlSqTN8dVBxqQXRs2Ji+SYTCUtijAvKF1+eWNfF927LeUBACodFSReI5bcfPQl5XgSkZOZz9tU+pjy4ricsgb1ko66A1rNWLLvtQMSc5SDQCfQm+P40k7FxvP/BwlKgQ3p0QHrvYwKzOXujhsqVC65Y/HeNIiQmQma54H52yDZ3uqraBkIABVCLRDotTv26SydDPWWZM+7uq96PtrR+bURMTRXs4EdGv3iBto7mTxB9h80ofnwsff3036cmWJx5TUHSd2uuUYiWuejcDbJ0d1SC1Fwx+dWrTYTgJycq9f5o88+crjt1WgPb/FxTXaiAzZyakH9/gmejlrW0ecasz8k00Rm2md+kR2bEJtung5c7D8fQG6pmDZsn2TI5tQV0tBI8tjgbM2uHLa8Q7KrGGpkwx+GXSrMxIcolj4JsmMZrm1Y0npNCvxPHI5wzZcmhTOwnNHrRr2TCrDi7ewHaduSUIoBy19UkX0NOGnvVfeDGh1BI7QdQi0hVdeeBfdZV9fh16C6vEGCBdLvhJp4ALpS8os+ml7t3BRwRLOCcvY/aTerQceXhEpk+KB2DjICin07D/XKEZBVg++oDr3nnwN2OHcRc+GOo2NyQcV3y6SGiFJyOeDpeDoF/IR4zkGZKZPlrEsw5HCJJCMWB8w13kq+Zlp4i9+UDI1E3gZnHnKb4eVzZFWvhJhkNfy7ii8C4/9I0gll/z7bGxBIZ9GGV7rBG9eF72hGVeRMLcqc05xSQ2RDZrWqvAbsszGNiDpnopecHArgB/5qeUacoTMTonqYIUAq1AtFvy5oVXyR2jweYS2KviKpLsm/h6kcF/mHT0hQzfLoF2/y3qyLP/1n2J8PC9D4kZU 3TIYJaRi /VlldB2VaXusL+rduY2UJTbLmhzwaHXmO8Mg18i1Y/9tq18h5Ak8/NXfCsLA05HXSiwbUkNXRqmi6SEiA1bPurWGgxEBCR9h9irEWgX6U7bt8emaaj+OkoxCI/FuyvwsoYRrm1Xzy3ek4Bz85UYKXCxuXRG4pLWXVYmmTvXe6w4ppMlEdVYenp8us0tzyktQ7KxR9BGFmhXufiTx/3U2n28f+HYK6b8lgZeDnRSpvZWqBkW0pngFb1RdNB1AX5tByucjQfP7aSarEak8D9t6LyLKqxA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Feb 24, 2023 at 02:31:15PM +0000, David Howells wrote: > Here's the simplest fix for cifs_writepages_region() that gets it to work. > > Fix the cifs_writepages_region() to just skip over members of the batch that > have been cleaned up rather than retrying them. I'm not entirely sure why it > fixes it, though. It's also not the most efficient as, in the common case, > this is going to happen a lot because cifs_extend_writeback() is going to > clean up the contiguous pages in the batch - and then this skip will occur for > those. Why are you doing it this way? What's wrong with using write_cache_pages() to push all the contiguous dirty folios into a single I/O object, submitting it when the folios turn out not to be contiguous, or when we run out of a batch? You've written an awful lot of code here and it's a different model from every other filesystem. Why is it better?