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 8167FC433FE for ; Wed, 16 Nov 2022 13:50:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 83E3C6B0071; Wed, 16 Nov 2022 08:50:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EE286B0072; Wed, 16 Nov 2022 08:50:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DCCB6B0073; Wed, 16 Nov 2022 08:50:23 -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 5F18C6B0071 for ; Wed, 16 Nov 2022 08:50:23 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B621A1A09EA for ; Wed, 16 Nov 2022 13:50:21 +0000 (UTC) X-FDA: 80139439842.11.ABFCB73 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf13.hostedemail.com (Postfix) with ESMTP id 0030E20005 for ; Wed, 16 Nov 2022 13:50:20 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 1C0E468AA6; Wed, 16 Nov 2022 14:50:17 +0100 (CET) Date: Wed, 16 Nov 2022 14:50:16 +0100 From: Christoph Hellwig To: Theodore Ts'o , Jan Kara , "Aneesh Kumar K.V" , Mingming Cao Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: generic_writepages & jbd2 and ext4 Message-ID: <20221116135016.GA9713@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668606621; a=rsa-sha256; cv=none; b=DyDjhNiWnQ1EPge7tV5Ekg2BPSxZNeEOK2bNZ9S2rLgVUx0v3A0ZdAwnBTjSONkorfK7nH db5iP28z3hEjfojWSUtFyPV7DKsSjB7gy1+oaw1QlYMewwGQ3W1zFBjG3MV4eVriDnfZze toOrOk3NQ23LSHvzENo68t9fwRAmWfw= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=none; spf=none (imf13.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668606621; 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: references; bh=I58ePTtRZaKKm++mQe8kpborp6qhIyVl3mb3ixOsGcA=; b=gWLcV+t646pE7DCyCfFQYXBHwtpgBeztq6I4QZq1Zzps77EGjURLDdp4kdbFNsno0b8lSn Ue9oFZgeQQ7l7a1baGmxmiFv6sA37Zi4KxWicXUgkOTvjHyabet6PqM6QZyN6POT4/iW1Q se7vzWkfwvD1Sa1NAiY1t3ZPrZA9VEk= Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=none; spf=none (imf13.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Rspam-User: X-Stat-Signature: nddzr8gxaypwcrf5uby4odoyebewikk4 X-Rspamd-Queue-Id: 0030E20005 X-Rspamd-Server: rspam11 X-HE-Tag: 1668606620-907875 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: 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?