Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1513166rdh; Mon, 25 Sep 2023 15:31:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMTyupFGzTQKv5SdeT7Qwk8EDtDutA62hPiouSmHxYJ9AICMypoPsldwGDfeGpXBnzNLIG X-Received: by 2002:a17:902:ecca:b0:1c4:65d5:34ce with SMTP id a10-20020a170902ecca00b001c465d534cemr1190388plh.31.1695681060706; Mon, 25 Sep 2023 15:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695681060; cv=none; d=google.com; s=arc-20160816; b=e3TWUoBA322KKZ1VmVDbwvFb+Qi7CgBUJ2lizeBWp9l/tFJVC1OF+TJiu6sc2ackO2 0yAZuKYvA+/ss/DegeA9Ax5zz142W+y7QHuUTbENyLny4VLeHLfIq5eGsL740w1VytLj LOgU6CuuSZgLtkU27VFSIhhe4QJVI7NHiVpePQwxb084CGnNjpfiaM4FgnC1nqNkE37K ryS6ia9Zke5LYkttQBNqXy+nLDZTQs/bvjQjrAWqG8iJym4GxHHKkZ1DL7NgJ37DgE9p VRTO/MeUAXCMpadkN0mYak/UyTDYIAk/P1thTtT8NPxZo88daVBwDuZpLGn6KlQj39Vb o7+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=A3CURX8d3cYG1fQrKnA7galRUzLSX0ZMwE51Q1+NG/M=; fh=ZoOLJxUsoKBo2B4OrHAgWh6pSG2b+sJyMERYJRCcvms=; b=U5wctedUxHhA8/gvdnvvT4flvwAyUDy6YXveovVbD6xG1O6BKCST208gUkXzOzkunY 2pkXA++mhTcR++j7x2k+0ArVvMq0EoKSaGeKeBcePtLHryrZDfwsCZ7KT1KIN7i/OtcF fbgKdcRROgrg56+/LYImeQ5Kx7Rl8c/upECbuhqO25BNKtAetd9aZJx7LDzsMmmMWwGJ /TIz8I8v6ypLNDOtUPpKgTibeeRbtOY/d+obAEC2U7Zf5njAyOINMktv2g5lEKV6cpK+ Z+Xcxt4Ie9iH4lc7U+o1ArN+d7Q9kSAKN08UusYVIDAL7iN0+FX/afbFQ6UwZDL2pFXs Xbxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="ZTrDrz/A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k70-20020a638449000000b00577f6b56757si10984736pgd.495.2023.09.25.15.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 15:31:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="ZTrDrz/A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1B66B8093D66; Mon, 25 Sep 2023 09:03:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232503AbjIYQDP (ORCPT + 99 others); Mon, 25 Sep 2023 12:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232577AbjIYQDO (ORCPT ); Mon, 25 Sep 2023 12:03:14 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A17910E for ; Mon, 25 Sep 2023 09:03:06 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b9c907bc68so114219951fa.2 for ; Mon, 25 Sep 2023 09:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1695657784; x=1696262584; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=A3CURX8d3cYG1fQrKnA7galRUzLSX0ZMwE51Q1+NG/M=; b=ZTrDrz/AS+nSfWzz7rdVzupkBeLXtr5p9xwvSs6+QnY0E/LYcfTrUPcfYek0gVPZ8W dJ7+8EPXJmEqKaDsZIwXbCFR0/xUY0RFv9nPcvOKWjxdlXjI/y4Hoe7HmXl7ouppoKcg xdCHVDZuPyt92BMQu/FylPeRF5Jga7AZb/22s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695657784; x=1696262584; h=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=A3CURX8d3cYG1fQrKnA7galRUzLSX0ZMwE51Q1+NG/M=; b=Z3EAUKP3bfJMJ74/izw6/Skf2/LkP90nECkLELQOJCRXroqJemtrDb1PG4/7KzbHP2 +olOQ0oSBvGCfgiRJWF9gKap4Uh657FB5OXRIFuXNVqa0qk4Tk33SmcHjBv0VSlTvLGE bWD6aXDuOtWeUALKfl9rxmkEeN5n7K1DmTcne1SruTtgq+7U0ENfHzs2s6BEWj2dpMrA lh2oHifD9EXwCfIx18mXR1EzuYykyG5liFINBXBBk4dZcGQONLJri6S75AoeERfNc/cD 0XBnIRG3CNZtan4gI0ieotZ2WU130XrYc0dhs2EXT1M4SiXuhf8jwPOWT/MnPFN0GUzV RTFQ== X-Gm-Message-State: AOJu0Yxx9gdCNdLXnfRuc4ZU4oPA0u16rT6SmI5X0bf5hJlW7waSCiGp WCBTiIHLK/Euu06EQGAtbFOqH4wPHer6AsnF+BAWAA== X-Received: by 2002:a2e:720a:0:b0:2b6:bb21:8d74 with SMTP id n10-20020a2e720a000000b002b6bb218d74mr5829056ljc.1.1695657784389; Mon, 25 Sep 2023 09:03:04 -0700 (PDT) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id p20-20020a2ea414000000b002bffa125afesm2259327ljn.48.2023.09.25.09.02.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Sep 2023 09:02:58 -0700 (PDT) Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2b9c907bc68so114213151fa.2 for ; Mon, 25 Sep 2023 09:02:56 -0700 (PDT) X-Received: by 2002:a2e:800c:0:b0:2bc:dd96:147d with SMTP id j12-20020a2e800c000000b002bcdd96147dmr6582130ljg.28.1695657774017; Mon, 25 Sep 2023 09:02:54 -0700 (PDT) MIME-Version: 1.0 References: <20230921-umgekehrt-buden-a8718451ef7c@brauner> <0d006954b698cb1cea3a93c1662b5913a0ded3b1.camel@kernel.org> <9ee3b65480b227102c04272d2219f366c65a14f3.camel@kernel.org> In-Reply-To: <9ee3b65480b227102c04272d2219f366c65a14f3.camel@kernel.org> From: Linus Torvalds Date: Mon, 25 Sep 2023 09:02:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL v2] timestamp fixes To: Jeff Layton Cc: Amir Goldstein , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , "Darrick J. Wong" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 09:03:22 -0700 (PDT) On Mon, 25 Sept 2023 at 04:23, Jeff Layton wrote: > > The catch here is that we have at least some testcases that do things > like set specific values in the mtime and atime, and then test that the > same value is retrievable. Yeah, I'm sure that happens. But as you say, we already have per-filesystem granularity issues that means that there is some non-ns granularity that those tests have to deal with. Unless they currently just work on one or two filesystems, of course. > Of course, that set truncates the values at jiffies granularity (~4ms on > my box). That's well above 100ns, so it's possible that's too coarse for > us to handwave this problem away. Note that depending or enforcing some kind of jiffies granularity is *particularly* bad, because it's basically a random value. It will depend on architecture and on configuration. On some architectures it's a fixed value (some have it at 100, which is, I think, the original x86 case), on others it's "configurable", but not really (ie alpha is "configurable" in our Kconfig, but the _hardware_ typically has a fixed clock tick at 1024 Hz, but then there are platforms that are different, and then there's Qemu that likes a lower frequency to avoid overhead etc etc). And then we have the "modern default", which is to ask the user at config time if they want a 100 / 250 / 300 / 1000 HZ value, and the actual hw clock tick may be much more dynamic than that. Anyway, what I'm saying is just that we should *not* limit granularity to anything that has to do with jiffies. Yes, that's still a real thing in that it's a "cheap read of the current time", but it should never be seen as any kind of vfs granularity. And yes, HZ will be in the "roughly 100-1000" range, so if we're talking granularities that are microseconds or finer, then at most you'll have rounding issues - and since any HZ rounding issues should only be for the cases where we set the time to "now" - rounding shouldn't be an issue anyway, since it's not a time that is specified by user space. End result: try to avoid anything to do with HZ in filesystem code, unless it's literally about jiffies (which should typically be mostly about any timeouts a filesystem may have, not about timestamps themselves). Linus