Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp63415rdb; Tue, 31 Oct 2023 00:04:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4wFf8HpED9AGBuDdkZYHmQ9cYkv2jR2PTMeq3t4Vp+mcAk5hwAc6H/+Phensx3HlEi4hn X-Received: by 2002:a17:903:244b:b0:1cc:60ca:8f24 with SMTP id l11-20020a170903244b00b001cc60ca8f24mr3077018pls.45.1698735868704; Tue, 31 Oct 2023 00:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698735868; cv=none; d=google.com; s=arc-20160816; b=yFGsCe9AaNlKTwCmTbbXErxrKQOjaJW+ONQto/KrG8S3LHnM9GkZREyaCwNc4QAxu4 bSYgYsALoh0tFIIfFSOIi6fnhS76QtSL5quwisogLMrW0oNglUDPAVC+ZplBCe0zPMoH hwCaGAVAv3/i8lBbIe4W4QEinvBLuvD0XDI/EG1ZOqwyMZBQ2GOGk13T0xwYRSay4Va6 EPVZI726cHFVBFApdNGWUXQBi3bOv1JhQ6YJJl2vW4tfskTC+lU4lf6uo4vwnNFj5pwy wJFvfpxTy/q/HK95cMlqYem99QX119X82HFPCYAIMGT4AhfEFUTAU+naj6IDlTW5PIOz dlXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/QHIvEcmJ0urypIUJ4I1hXriZ0FhrfT5zBc+eZq8EH4=; fh=yjIHETayRiNSEQEvPtJajswvon/j6Az7lhYJ8zhdTYk=; b=qrRKrF0XLbG8xhTJxAs8CCmAPZPOzGosxZVKXPVz4eQC6/CwLLqwSYswspYE2egix3 zW6S1Ooq1q8ICvX/h3CJM330waLgV6lBueBAH7MEHX1XDMEi+OUNR7AtN3/6BU581v2D Hvq9wLQAzl5Nd1khLcLKtxKEvuQ1fakBx6BilYs/l3kkHgldUoCTwdY0vWJrlUZjifI4 XGTghVjcevz+sdONZXgkb3Ob+84CG+WOkoNvs8SAsaFF4ZaTEoVEIJZoANbbkCZIcp5j itcJigfEbvzQOh36ONbX3FpxzpARw6PxsfPIuKKtK5t/VRxdw+DFeRKq6+rYFMgGTf8i VnOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RGu8sDMn; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s9-20020a170902ea0900b001c9c108bf6esi609720plg.387.2023.10.31.00.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 00:04:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RGu8sDMn; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 10B7880B8DD1; Tue, 31 Oct 2023 00:04:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343556AbjJaHEN (ORCPT + 99 others); Tue, 31 Oct 2023 03:04:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343495AbjJaHEM (ORCPT ); Tue, 31 Oct 2023 03:04:12 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33BCBC1; Tue, 31 Oct 2023 00:04:10 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3b2ec9a79bdso3722468b6e.3; Tue, 31 Oct 2023 00:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698735849; x=1699340649; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/QHIvEcmJ0urypIUJ4I1hXriZ0FhrfT5zBc+eZq8EH4=; b=RGu8sDMnVECcxZipxda9i97yZ/pIfwDsIIb+3b2zZq56s1BY6VCn5HmyXldhnmvzzc 8i+fmOuZk8f1KZ7pxAxYYHVN6qyrkTRGZt8l6IOZV7GR3wn36jluzhJ0rUp0fZTnHKyv X0d4u+vJ7i7/t3zxhEjrujgwrdgeS4FgJj8pTAWnAXStlVFmJQ8JxezRreBusixqW1bm YHWEb2hFmdozsss/cKJeMpdQuCyNw5PFL6w6wPXHPFVqJE7DsLZuHODdvnnvroLwpMsZ 7e2zybt171UfnePSC2axUVAIuWPT0+6GppjANhk0UtiLtWf8NIYUO1LiubYQlyl9gCSx T8sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698735849; x=1699340649; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/QHIvEcmJ0urypIUJ4I1hXriZ0FhrfT5zBc+eZq8EH4=; b=dHYIGGMJrnxtshFvdGVFK2mx96a31Mwt4br4T3G/JZ3SrvbXvl5wxrA8u6OAuALP+x zZg/2wvFtwz9+qV7daNCkB6JMBfB4JQpeozEPKZGWv1doK2/30PyXOEgWDigUlkZati3 Ty/rztRD3pW17Inpv5cXYfC1Z8R+AcapClWxfc7pJG5CFt4Y7H4UlMR3NsCy9mmGcOn1 GI7NTDOyGak1xNK4NiuLwdqXnOhO87hzz3W0FwkMG6rsKFgMsDPzz/+WwbDBemKZctaP /ShDX4VHsLvg0bXi/STdMzsfb3qWygDKK9siHAEBR4fVCOLtgHCPkF9eDyw884UPvyjo Batg== X-Gm-Message-State: AOJu0Yx5ImwNhoFQ2lZRM2zNZWHGZwerLDD2uIXQCqw4/FUsIY75oPBW GLkrhi/NCfUt35O+Ie3nL4qgAO+iuxe9sxzoCbQ= X-Received: by 2002:aca:909:0:b0:3b0:da4a:4823 with SMTP id 9-20020aca0909000000b003b0da4a4823mr12874300oij.56.1698735849512; Tue, 31 Oct 2023 00:04:09 -0700 (PDT) MIME-Version: 1.0 References: <2ef9ac6180e47bc9cc8edef20648a000367c4ed2.camel@kernel.org> <6df5ea54463526a3d898ed2bd8a005166caa9381.camel@kernel.org> In-Reply-To: From: Amir Goldstein Date: Tue, 31 Oct 2023 09:03:57 +0200 Message-ID: Subject: Re: [PATCH RFC 2/9] timekeeping: new interfaces for multigrain timestamp handing To: Dave Chinner Cc: Linus Torvalds , Jeff Layton , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 31 Oct 2023 00:04:25 -0700 (PDT) On Tue, Oct 31, 2023 at 3:42=E2=80=AFAM Dave Chinner = wrote: > [...] > .... 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. > > 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. > > > 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. > > Yet I don't want i_version to track di_changecount. > > I want to *stop supporting i_version altogether* in XFS. > > I want i_version as filesystem internal metadata to die completely. > > 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. > > 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*. > > 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.... > 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. 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). 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. 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. 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. Speaking on behalf of my employer, we would love to see the data modification-cookie feature implemented, whether in vfs or in xfs. *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 work. Thanks, Amir. [1] https://github.com/amir73il/fsnotify-utils/wiki/Hierarchical-Storage-Ma= nagement-API