Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1028183ybp; Thu, 17 Oct 2019 07:04:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSTHiZK+V2Zw3ghKZDFvF+QEvlROuKUNx8MoIX/6hM3u2D0YaIh1U/oc1A5hwhpdCVvDT7 X-Received: by 2002:a05:6402:b38:: with SMTP id bo24mr4031468edb.103.1571321087525; Thu, 17 Oct 2019 07:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571321087; cv=none; d=google.com; s=arc-20160816; b=te90z4/XsT2q0F8HDIKxNIEnOHd46RtzVSbYWZGtgBX9u+Ev+DUiTqqynOp0fQL4VM uR7VKxB32yn7AhkJIghW8b6z88x9yR8Pmr1YRpwq4E0MlDF0/aoNmS8gQGLNk+aUVGgh k19rvdvD1CiEZ/Bja/m8Hx4VbkvSFbE8LkBde2GgYyGQ02udhWWwcYVKOZnc+Yuqcsyb rMYfqqXx+n9OBAvQ/v5WcvAKPZizH8yyQxTWHpeviFPbn4hjulqXVVOnHsIcWC+bWDuv bgwwFaaL2yom5MoDdn7xLEZaP7IUtWPBQL80NvU+Oxc0wdPaELv0KW8BnCuEvE5YZBet YlSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jmuU9DmOa8+scCWkboIYozrgiYEMoC9e4KXxZzaZh9Q=; b=KxPGj4hkTvRHfjvCn8nTGz6+pybyOw1kP/7DyphLENd7YY3iCWC5wiseE3EUHgtqLm 22Y0+AZCplRyx24/RmzGEZ/Yu5xCGQ6sUNa/1mrKMdEZpAtKg7v5GSTrVb3Bb9Lvfriq +JE9fzYhxg7a5qs7Y8/RWv8UWSsz/BW8q3GSkODMd8bzfLQT46Wpu/6uNEl5ChifN8yu vMYxndYiygLV7QZk1s6vDpYYE/gK2OlmPWB8XDX4qc6sULcevXTKHcsyhofTSsODXg2j 3UmBw1qbOgCBPsVdMKLJVKijpDtXV0efkA1g7ip2TogEQyXIsAO7yTmwq6AT2U6j83I6 slfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca4si1509430ejb.39.2019.10.17.07.04.10; Thu, 17 Oct 2019 07:04:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729725AbfJPVhA (ORCPT + 99 others); Wed, 16 Oct 2019 17:37:00 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:39591 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729033AbfJPVhA (ORCPT ); Wed, 16 Oct 2019 17:37:00 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-98.corp.google.com [104.133.0.98] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x9GLauvJ005521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Oct 2019 17:36:57 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id C9B30420458; Wed, 16 Oct 2019 17:36:55 -0400 (EDT) Date: Wed, 16 Oct 2019 17:36:55 -0400 From: "Theodore Y. Ts'o" To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH v3 08/13] ext4: fast-commit commit range tracking Message-ID: <20191016213655.GH11103@mit.edu> References: <20191001074101.256523-1-harshadshirwadkar@gmail.com> <20191001074101.256523-9-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001074101.256523-9-harshadshirwadkar@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Oct 01, 2019 at 12:40:57AM -0700, Harshad Shirwadkar wrote: > With this patch, we track logical range of file offsets that need to > be committed using fast commit. This allows us to find file extents > that need to be committed during the commit time. We don't actually need to track when data is modified in the page cache, which is what this commit is actually doing. We only need to track newly allocated blocks, at granularity of the logical block number. That's because we only need to force out newly allocated blocks to make sure we don't reveal stale data when we are in data=ordered mode. And it also follows that we don't need to track logical block ranges and submit inode data in data=writeback or data=journalled mode. In the case where the user has actually called fsync() on the the inode, we do a data integrity writeback in ext4_sync_file, and that's independent on the fast commit code. But if the file is being modified using buffered writes, or if an already allocated block is changed, and the file has *not* been changed, we don't need to write out those blocks on a fast commit. For example, in the case where we are the fast commit is being initiated via ext4_nfs_commit_metadata() -> ext4_write_inode(), we only care about submitting data for the newly allocated blocks. And that's what we want to track here. Hence, all of the callers of ext4_fc_update_commit_range() here are in the wrong place. (Also, they are calling ext4_fc_update_commit_range with byte offsets, when the function is expecting logical block numbers, but that really matter, since the existing call sites need to be all removed and replaced with new ones in ext4_map_blocks(). - Ted