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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9C71C4332F for ; Mon, 21 Nov 2022 07:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbiKUHRL (ORCPT ); Mon, 21 Nov 2022 02:17:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiKUHRK (ORCPT ); Mon, 21 Nov 2022 02:17:10 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E5213DFA; Sun, 20 Nov 2022 23:17:08 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 2E4FB68AA6; Mon, 21 Nov 2022 08:17:05 +0100 (CET) Date: Mon, 21 Nov 2022 08:17:04 +0100 From: Christoph Hellwig To: David Howells Cc: linux-afs@lists.infradead.org, Marc Dionne , Christoph Hellwig , Matthew Wilcox , Theodore Ts'o , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] afs: Stop implementing ->writepage() Message-ID: <20221121071704.GC23882@lst.de> References: <166876785552.222254.4403222906022558715.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166876785552.222254.4403222906022558715.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Nov 18, 2022 at 10:37:35AM +0000, David Howells wrote: > A hint flag is added to the writeback_control struct so that a filesystem > can say that the write is triggered by write_begin seeing a conflicting > write. This causes do_writepages() to do a single pass of the loop only. Not a huge fan of that, especially as write_begin is not really a method, but just an awkward hook in legacy write implementations. I'd much rather have a private pointer in the writeback_control and make the behavior implementation specific. It will need to be split into a separate patch with proper documentation and a CC to linux-mm. > (1) afs_write_back_from_locked_folio() could be called directly rather > than calling filemap_fdatawrite_wbc(), but that would avoid the > control group stuff that wbc_attach_and_unlock_inode() and co. seem to > do. Do I actually need to do this? That would be much preferred over the for_write_begin hack, given that write_begin really isn't a well defined method but a hacky hook for legacy write implementations. > (2) afs_writepages_region() has a loop in it to generate multiple writes. > do_writepages() also acquired a loop[2] which will also generate > multiple writes. Should I remove the loop from > afs_writepages_region() and leave it to the caller of ->writepages()? Dropping out of ->writpages inside a page does seem a bit problematic, so you probably want to keep the loop.