Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1714391rdb; Thu, 7 Dec 2023 07:03:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBUvmmDS9kP/kECeaA399A4jmn44sNE4oEMnJrVJZluW/CAjYFKogX4Si+Gn84JaF7VA1/ X-Received: by 2002:a05:6a21:7891:b0:18f:e3fb:8cf2 with SMTP id bf17-20020a056a21789100b0018fe3fb8cf2mr2675210pzc.84.1701961420276; Thu, 07 Dec 2023 07:03:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701961420; cv=none; d=google.com; s=arc-20160816; b=TLykJD9u7JWUopu5DEttofXxMazLeYMgce6KsFmhtxVF4D8oUw1ZNxOh4ai2Ai3Rc6 y/IAnv0DB3qx8sUou82pSMloOl7DQtVL6DpB3K5FPnYLvB2iwzJJvil6HjfyOUZ0Dq1G B8eUhKu2gKdn76S+bOWvqKX3XlvcBukqler3pYH21q/jkS9ZyOVez6HzQiV9vkScAgVg TRJ4SnXKrZAM1/rSI7UBm8omlAHg1bR2zBfKCrOhmAV9xfugijjYUCUOgXVq8KWtgTim 8oQrjOTcbUBCWohcU2BD/c+J8DGiltbZrGn6bAnliY/grpKrcrBJDJWgehd2M5gpkvD2 eOZw== 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=uF0wFeJ9Qbf/I5Jz33BcHuRNr3/sko41SEtcMzY/++8=; fh=Y8TufXU7WBdv+G577+iNV9InUZ0may/e6kQTUZaMaFk=; b=0rwx3g0s70YDVMwz691YSt2oTm2eOOs0/BZ4qHKw7Z85iqTZLoZO9Xx3WAyLyQsMR1 6bkUSvGanHItAuGYvcIu61T9HeLyfuRxtzPJ3R5j4PckFppPsFioZMjGYeBFFeSXCj6k iJVSrzkG1NUoFD80TEkzCrsptc/q7lVzYw/QRhrA2kGBM313yU6dxDozvTanO81p/p+d dLUaqbg9Rl+1hesHSFL1navPUdwmiP+Cpu+ndPSBUlhnxxCG0nDCBOyQaj82eCnOfOVV I0EUZb1cqT/weAp9L2wKN2ZQiPVTEn6XxD/YwbhPhjaR/xKWmLLfPMzIcQwowtC4e/l7 1KSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-339-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-339-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d13-20020a631d4d000000b005c67bf38069si1256138pgm.320.2023.12.07.07.03.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:03:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-339-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-339-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-339-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C83BBB2155A for ; Thu, 7 Dec 2023 15:03:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F13A44439B; Thu, 7 Dec 2023 15:03:21 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4031128; Thu, 7 Dec 2023 07:03:15 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 04D90227A87; Thu, 7 Dec 2023 16:03:12 +0100 (CET) Date: Thu, 7 Dec 2023 16:03:11 +0100 From: Christoph Hellwig To: Zhang Yi Cc: Christoph Hellwig , "Darrick J. Wong" , Chandan Babu R , Ritesh Harjani , Jens Axboe , Andreas Gruenbacher , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gfs2@lists.linux.dev, Christian Brauner , linux-ext4@vger.kernel.org, Theodore Ts'o Subject: Re: [PATCH 13/14] iomap: map multiple blocks at a time Message-ID: <20231207150311.GA18830@lst.de> References: <20231207072710.176093-1-hch@lst.de> <20231207072710.176093-14-hch@lst.de> <4e4a86a0-5681-210f-0c94-263126967082@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-ext4@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: <4e4a86a0-5681-210f-0c94-263126967082@huaweicloud.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Dec 07, 2023 at 09:39:44PM +0800, Zhang Yi wrote: > > + do { > > + unsigned map_len; > > + > > + error = wpc->ops->map_blocks(wpc, inode, pos); > > + if (error) > > + break; > > + trace_iomap_writepage_map(inode, &wpc->iomap); > > + > > + map_len = min_t(u64, dirty_len, > > + wpc->iomap.offset + wpc->iomap.length - pos); > > + WARN_ON_ONCE(!folio->private && map_len < dirty_len); > > While I was debugging this series on ext4, I would suggest try to add map_len > or dirty_len into this trace point could be more convenient. That does seem useful, but it means we need to have an entirely new even class. Can I offload this to you for inclusion in your ext4 series? :) > > + case IOMAP_HOLE: > > + break; > > BTW, I want to ask an unrelated question of this patch series. Do you > agree with me to add a IOMAP_DELAYED case and re-dirty folio here? The > background is that on ext4, jbd2 thread call ext4_normal_submit_inode_data_buffers() > submit data blocks in data=ordered mode, but it can only submit mapped > blocks, now we skip unmapped blocks and re-dirty folios in > ext4_do_writepages()->mpage_prepare_extent_to_map()->..->ext4_bio_write_folio(). > So we have to inherit this logic when convert to iomap, I suppose ext4's > ->map_blocks() return IOMAP_DELALLOC for this case, and iomap do something > like: > > + case IOMAP_DELALLOC: > + iomap_set_range_dirty(folio, offset_in_folio(folio, pos), > + map_len); > + folio_redirty_for_writepage(wbc, folio); > + break; I guess we could add it, but it feels pretty quirky to me, so it would at least need a very big comment. But I think Ted mentioned a while ago that dropping the classic data=ordered mode for ext4 might be a good idea eventually no that ext4 can update the inode size at I/O completion time (Ted, correct me if I'm wrong). If that's the case it might make sense to just drop the ordered mode instead of adding these quirks to iomap.