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 A5417C433FE for ; Wed, 16 Nov 2022 15:36:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC7FF6B0071; Wed, 16 Nov 2022 10:36:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D77EC6B0073; Wed, 16 Nov 2022 10:36:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3FF86B0074; Wed, 16 Nov 2022 10:36:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B646A6B0071 for ; Wed, 16 Nov 2022 10:36:49 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6196DC04CA for ; Wed, 16 Nov 2022 15:36:49 +0000 (UTC) X-FDA: 80139708138.28.006D73E Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf12.hostedemail.com (Postfix) with ESMTP id AA89B4000E for ; Wed, 16 Nov 2022 15:36:47 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 50A47336F9; Wed, 16 Nov 2022 15:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668613006; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sLkFAGmODAxxEkX02jVvJl4offD9YV13b3F5VPNgrjo=; b=kpjpxKkatXq3EwXIEV+LmXYPlqGug+rL5rx5o/rJsc933/eJpQbsD/p+rNma92cYKNiNi1 YdbC8GzWo43ZCdPFeaihAJ6HjcQHTDA9QISSKxypcBCuyZTXIUE2VVhStpcpCr29l9V9gK NTPHHOb0fLFUwA3NGMDRPUOi0JO3U8I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668613006; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sLkFAGmODAxxEkX02jVvJl4offD9YV13b3F5VPNgrjo=; b=y2zMGOWs/dn5QvLOUYvocvGltUMPBoQY2jZjWa1CBM1nVurW1yi34qHOJja8krFBYkjmXb 4nRfZRBmBobFkTDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2E2A513480; Wed, 16 Nov 2022 15:36:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7Ro3C44DdWNscgAAMHmgww (envelope-from ); Wed, 16 Nov 2022 15:36:46 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 46F12A0709; Wed, 16 Nov 2022 16:36:44 +0100 (CET) Date: Wed, 16 Nov 2022 16:36:44 +0100 From: Jan Kara To: Christoph Hellwig Cc: Theodore Ts'o , Jan Kara , "Aneesh Kumar K.V" , Mingming Cao , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: Re: generic_writepages & jbd2 and ext4 Message-ID: <20221116153644.7rqgb6a4nyei3ltz@quack3> References: <20221116135016.GA9713@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221116135016.GA9713@lst.de> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668613008; a=rsa-sha256; cv=none; b=da5tuspizj90mUkHL8oBH2PcUMOR/k/E96wnrWymIntbMBC8eivxX9kAMMIzd+6C43A18e 7KsFUgn5UIDEiVANl8z3G4eHVD2b1etZFUuvpaLbpQkHDbmOh9VD5rfofGxqJ7g97sJiop LQZpJjWY5qw66npMqx2KNRy1MMc3JzM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=kpjpxKka; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=y2zMGOWs; spf=pass (imf12.hostedemail.com: domain of jack@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668613008; 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=sLkFAGmODAxxEkX02jVvJl4offD9YV13b3F5VPNgrjo=; b=Vb5rcwnCbIkGOM8bQccZcIkHUUpaI7j3T7FvNnrItIPm9d8k1GOAUuW36MTjYN8/uu1b5f rOLfqHmWJq87+Gcc+Cd5VD4TgEuN44W/b0lXAKsuP9O5pYc2KjGM91QDF/LsGl5aGVD9P2 AWcqLOWpbne/56GXI+9s1BSlqSaJpTU= X-Stat-Signature: u58cihew9wt1z8hs53ohp9y5rg7xg8kz X-Rspamd-Queue-Id: AA89B4000E Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=kpjpxKka; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=y2zMGOWs; spf=pass (imf12.hostedemail.com: domain of jack@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1668613007-431651 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 Wed 16-11-22 14:50:16, Christoph Hellwig wrote: > Hi all, > > I've recently started looking into killing off the ->writepage method, > and as an initial subproject kill of external uses of generic_writepages. > One of the two remaining callers s in jbd2 and I'm a bit confused about > it. > > jbd2_journal_submit_inode_data_buffers has two comments that explicitly > ask for ->writepages as that doesn't allocate data: > > /* > * write the filemap data using writepage() address_space_operations. > * We don't do block allocation here even for delalloc. We don't > * use writepages() because with delayed allocation we may be doing > * block allocation in writepages(). > */ > > /* > * submit the inode data buffers. We use writepage > * instead of writepages. Because writepages can do > * block allocation with delalloc. We need to write > * only allocated blocks here. > */ > > and these look really stange to me. ->writepage and ->writepages per > their document VM/VFS semantics don't different on what they allocate, > so this seems to reverse engineer ext4 internal behavior in some > way. Either way looping over ->writepage just for that is rather > inefficient. If jbd2 really wants a way to skip delalloc conversion > can we come up with a flag in struct writeback_control for that? > > Is there anyone familiar enough with this code who would be willing > to give it a try? Yes, I've written that code quite a few years ago :) And I agree JBD2 is abusing internal knowledge about ext4 here. So yes, writeback_control flag so that we can propagate the information to ->writepages method should do the trick. I'll have a look into that. Honza -- Jan Kara SUSE Labs, CR