Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp171870rdb; Tue, 31 Oct 2023 04:29:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdo73UzPfGAPQAxwTsdCtd3Pi6hg31yZsqYumtYXVL1sls0hayNtlvbK04ZmP8A4SkRFLY X-Received: by 2002:a17:90b:11c4:b0:27c:ef18:d270 with SMTP id gv4-20020a17090b11c400b0027cef18d270mr9143263pjb.20.1698751778528; Tue, 31 Oct 2023 04:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698751778; cv=none; d=google.com; s=arc-20160816; b=EgSL/KsBReMDtg0JXqAkwl3PQfopOr6XFOg3RHXFcEB9Zj/jq4TMFjW2UO6O6YoUjf GPrIa5tDI99ytauAluHo3hjkUn7wxpQGZrWrRRkxovUj4r9+M/D2gHTZgwJDUR7bdLge QMU2Zy/pc6aCZlkXsBttSsZdOM5MZLmD6YmvyHNw1CZCMiCfk69F/zLZ7Sle1kI6dtQd Eart7JBc1il8NQvEuWWjcJbcguTH9XuZdKFkZIhc/6qmbJSgtBcagUS8UluQ8bfUwFBC pQ5sSGaGizPsIH7V8UlJxGvt5MMkRj2F4kgzNts0PgAsOwRKjgsc0PjEilhaM9W+vU0a 9c3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=fz3Kt6Eszm2Wav2Z48k0LnmutspePZBudBSBfqy6NRo=; fh=7m+tztmNcGfFFalqtAtA/9n/AHR/jWfS9kbRdBfyMBw=; b=cBv+u4CvA9GAKFDUSCFAJ7vWez1OaifaSM0mMnSPsyAKnLvarnRGkOb8PCkWKaJAvg iUx7RjzsOn5qNe9WFAw6jEtHXGw97oh8X/HUflJ6irk1ecGvj6oPXIhxJDIPFvjMjlbC 7+fptDqyV6WWpSKgXDoWBYeHyzYyFHY9uA7m4tgW33eTiayO/E8hPHhO9mBvBZXj3d1E XnSV3hSvEKfKJ/SWVpMDHWWG6WadF8hiYgGCZmfOF/y9YGi/mgUWdWp0U4SyUL1IBmGu r+/cD/ZVAMLivN/o1w0WchKfLYqB3Tn4nFBQL4kbI7anu6kYWGBz4M2nrhtZyIX+xtRo ECUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=szcK99jQ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id o14-20020a17090a4b4e00b002806ade3412si851729pjl.147.2023.10.31.04.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 04:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=szcK99jQ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 926F5807751B; Tue, 31 Oct 2023 04:29:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235475AbjJaL3Z (ORCPT + 99 others); Tue, 31 Oct 2023 07:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbjJaL3Y (ORCPT ); Tue, 31 Oct 2023 07:29:24 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5772691; Tue, 31 Oct 2023 04:29:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAC34C433C7; Tue, 31 Oct 2023 11:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698751762; bh=sQi8lLN99TqACM6Lr/LTk68QS9WcLZ1H4O7ExjoVBrM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=szcK99jQWDGhlXMi1UgH+Os3Ra+DjckTFa7eXi2kTman6U6wMaiPqiHE0ZUb7/2zU SxHagS2QXuXkot3N6SG26/AfQjhmkK3OTBneaxECmrkBwHlxt4tEEd2b5Vf4DVWEty +Gy4OK9zIxQsh7X9k178PrZDUB2B3ULtpSkR3p0AgVJPSURjL40mlCwxjTK1hAHwQV JCnIuZYdexIZDob5OIE0bV5CWZy/m8dHmIeGwvdmPApv4vcsah3tV52UAUfYKAR5Us 3of6oyBVaM+ko1bQu3KUaH+BILSplQUKX9RZpAnhyNe+62km1wfnW/C2jHnZmRv1AT crFIyLnj00vXg== Message-ID: <3d6a4c21626e6bbb86761a6d39e0fafaf30a4a4d.camel@kernel.org> Subject: Re: [PATCH RFC 2/9] timekeeping: new interfaces for multigrain timestamp handing From: Jeff Layton To: Amir Goldstein , Dave Chinner Cc: Linus Torvalds , Kent Overstreet , Christian Brauner , Alexander Viro , John Stultz , Thomas Gleixner , Stephen Boyd , Chandan Babu R , "Darrick J. Wong" , Theodore Ts'o , Andreas Dilger , Chris Mason , Josef Bacik , David Sterba , Hugh Dickins , Andrew Morton , Jan Kara , David Howells , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org Date: Tue, 31 Oct 2023 07:29:18 -0400 In-Reply-To: References: <2ef9ac6180e47bc9cc8edef20648a000367c4ed2.camel@kernel.org> <6df5ea54463526a3d898ed2bd8a005166caa9381.camel@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 04:29:35 -0700 (PDT) On Tue, 2023-10-31 at 09:03 +0200, Amir Goldstein wrote: > On Tue, Oct 31, 2023 at 3:42=E2=80=AFAM Dave Chinner wrote: > >=20 > [...] > > .... and what is annoying is that that the new i_version just a > > glorified ctime change counter. What we should be fixing is ctime - > > integrating this change counting into ctime would allow us to make > > i_version go away entirely. i.e. We don't need a persistent ctime > > change counter if the ctime has sufficient resolution or persistent > > encoding that it does not need an external persistent change > > counter. > >=20 > > That was reasoning behind the multi-grain timestamps. While the mgts > > implementation was flawed, the reasoning behind it certainly isn't. > > We should be trying to get rid of i_version by integrating it into > > ctime updates, not arguing how atime vs i_version should work. > >=20 > > > So I don't think the issue here is "i_version" per se. I think in a > > > vacuum, the best option of i_version is pretty obvious. But if you > > > want i_version to track di_changecount, *then* you end up with that > > > situation where the persistence of atime matters, and i_version needs > > > to update whenever a (persistent) atime update happens. > >=20 > > Yet I don't want i_version to track di_changecount. > >=20 > > I want to *stop supporting i_version altogether* in XFS. > >=20 > > I want i_version as filesystem internal metadata to die completely. > >=20 > > I don't want to change the on disk format to add a new i_version > > field because we'll be straight back in this same siutation when the > > next i_version bug is found and semantics get changed yet again. > >=20 > > Hence if we can encode the necessary change attributes into ctime, > > we can drop VFS i_version support altogether. Then the "atime bumps > > i_version" problem also goes away because then we *don't use > > i_version*. > >=20 > > But if we can't get the VFS to do this with ctime, at least we have > > the abstractions available to us (i.e. timestamp granularity and > > statx change cookie) to allow XFS to implement this sort of > > ctime-with-integrated-change-counter internally to the filesystem > > and be able to drop i_version support.... > >=20 >=20 > I don't know if it was mentioned before in one of the many threads, > but there is another benefit of ctime-with-integrated-change-counter > approach - it is the ability to extend the solution with some adaptations > also to mtime. >=20 > The "change cookie" is used to know if inode metadata cache should > be invalidated and mtime is often used to know if data cache should > be invalidated, or if data comparison could be skipped (e.g. rsync). >=20 > The difference is that mtime can be set by user, so using lower nsec > bits for modification counter would require to truncate the user set > time granularity to 100ns - that is probably acceptable, but only as > an opt-in behavior. >=20 > The special value 0 for mtime-change-counter could be reserved for > mtime that was set by the user or for upgrade of existing inode, > where 0 counter means that mtime cannot be trusted as an accurate > data modification-cookie. >=20 > This feature is going to be useful for the vfs HSM implementation [1] > that I am working on and it actually rhymes with the XFS DMAPI > patches that were never fully merged upstream. >=20 > Speaking on behalf of my employer, we would love to see the data > modification-cookie feature implemented, whether in vfs or in xfs. >=20 > *IF* the result on this thread is that the chosen solution is > ctime-with-change-counter in XFS > *AND* if there is agreement among XFS developers to extend it with > an opt-in mkfs/mount option to 100ns-mtime-with-change-counter in XFS > *THEN* I think I will be able to allocate resources to drive this xfs wor= k. >=20 > Thanks, > Amir. >=20 > [1] https://github.com/amir73il/fsnotify-utils/wiki/Hierarchical-Storage-= Management-API I agree with Christian that if you can do this inside of XFS altogether, then that's a preferable solution. I don't quite understand how ctime- with-change-counter is intended to work however, so I'll have to reserve judgement there. --=20 Jeff Layton