Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2525558pxb; Thu, 4 Nov 2021 23:22:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKNuq9Lro0yBm8G13+vS4eVO3j7FHB6P/JPcl4G7uQzboscAjEjHbUEJq8mg53dMQRY8hV X-Received: by 2002:a17:906:e115:: with SMTP id gj21mr12505601ejb.348.1636093346612; Thu, 04 Nov 2021 23:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636093346; cv=none; d=google.com; s=arc-20160816; b=av424eyQ7AfO8E7mvdI4YmqmlhUpFH5PEPTWcZTd0zPXABt6/d1HQVm+2UYeOuRcaz 7ppU4tXWkZrKJk1qzdUwvslRRDHLWazVm9rmkL9ZRXDyNVkpu606hVifoaN4EPoET2Kp Pg6VLEQrzMFuX9c0TLWLOywmKeKxvrrhvr7Wo3DW6pJ7CkXeYHSclCV9ObCUoyzwQxoc Xow6lYT1IMy/uwzAyAqsN9BCqGRPDIgJcoSo/hQmOZNeLey8fcVVS+DYVEXp0CwHLPxL 1qAZ7CYoqupcvACjFRqmv9ST+zbBZBLPM2iFLJKlt47ZcaiQPwJyCNpYAqmUkVUL+s8c rL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=2L7/AemJH5KIaVUhN1e27AhaBXwZkHOJyUT8srhONuA=; b=wrDmt1tK0m/qPuyMGYcL/j9+JdX7nmov0pmHxBCq0N7VgaOIV0rOyrx0WyOHVtm1xE C1P1TR/jtD006u5Z7S524BMfqe8jNyxcfKmupGKGhBAUIJsGy3qBDx7ZHfE3TTECOgr7 Y3mPrTYlafNiECz302lnFc4k9p8S5dAKqiE1MI7PQ74qbKHRt5Alba3+liqtwBJIj0hS m1meSR+JgbqEqS8NPykvGrdwPlVmKPnJzJ79Oyr7A+iQJvEbYmGfkDW3jw3e7MEi/S3x XItTb+U5T0wL7gA2TsJt8MArPxpto5DAccSyKZzY7gnSyjVpbyy1Ji9xdxr2rS6UzqRw DbNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qb2si14795067ejc.706.2021.11.04.23.21.43; Thu, 04 Nov 2021 23:22:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232068AbhKEFbD (ORCPT + 99 others); Fri, 5 Nov 2021 01:31:03 -0400 Received: from smtp181.sjtu.edu.cn ([202.120.2.181]:38092 "EHLO smtp181.sjtu.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbhKEFbC (ORCPT ); Fri, 5 Nov 2021 01:31:02 -0400 Received: from proxy02.sjtu.edu.cn (smtp188.sjtu.edu.cn [202.120.2.188]) by smtp181.sjtu.edu.cn (Postfix) with ESMTPS id 03F3C1008CBC1; Fri, 5 Nov 2021 13:28:20 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy02.sjtu.edu.cn (Postfix) with ESMTP id E3CD1200B8923; Fri, 5 Nov 2021 13:28:20 +0800 (CST) X-Virus-Scanned: amavisd-new at Received: from proxy02.sjtu.edu.cn ([127.0.0.1]) by localhost (proxy02.sjtu.edu.cn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HAz2J4nohqWJ; Fri, 5 Nov 2021 13:28:20 +0800 (CST) Received: from [192.168.11.167] (unknown [202.120.40.82]) (Authenticated sender: sunrise_l@sjtu.edu.cn) by proxy02.sjtu.edu.cn (Postfix) with ESMTPSA id F110E200BFDB1; Fri, 5 Nov 2021 13:28:10 +0800 (CST) Subject: Re: [PATCH] ext4: remove unnecessary ext4_inode_datasync_dirty in read path To: Dave Chinner Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, mingkaidong@gmail.com References: <20211102024258.210439-1-sunrise_l@sjtu.edu.cn> <20211103002843.GC418105@dread.disaster.area> <20211104232226.GD418105@dread.disaster.area> From: Zhongwei Cai Message-ID: <01e6abf4-3ae5-ecab-3b7f-876c8a3fcbb4@sjtu.edu.cn> Date: Fri, 5 Nov 2021 13:28:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211104232226.GD418105@dread.disaster.area> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 11/5/21 7:22 AM, Dave Chinner wrote: > > No. Some filesystems don't track inode metadata dirty status using > the VFS inode; instead they track it more efficiently in internal > inode and/or journal based structures. Hence the only way to get > "inode needs journal flush for data stability" information to > generic IO code is to have a specific per-IO mapping flag for it. > Could we add IOMAP_REPORT_DIRTY flag in the flags field of struct iomap_iter to indicate whether the IOMAP_F_DIRTY flag needs to be set or not? Currently the IOMAP_F_DIRTY flag is only checked in iomap_swapfile_activate(), dax_iomap_fault() and iomap_dio_rw() (To be more specific, only the write path in dax_iomap_fault() and iomap_dio_rw()). So it would be unnecessary to set the IOMAP_F_DIRTY flag in dax_iomap_rw() called in the previous tests. Other file systems that set the IOMAP_F_DIRTY flag efficiently could ignore the IOMAP_REPORT_DIRTY flag. Best, Zhongwei.