From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Jeff King <peff@peff.net>
Cc: Patrick Steinhardt <ps@pks.im>,
"D. Ben Knoble" <ben.knoble+github@gmail.com>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Ramsay Jones <ramsay@ramsayjones.plus.com>
Subject: Re: [PATCH] meson: wire up USE_NSEC build knob
Date: Mon, 29 Jun 2026 00:23:28 +0000 [thread overview]
Message-ID: <akG7AJxeiWc8KUYN@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <20260628084815.GA111587@coredump.intra.peff.net>
[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]
On 2026-06-28 at 08:48:15, Jeff King wrote:
> Oh, I also ran across this old thread:
>
> https://public-inbox.org/git/5605D88A.20104%40gmail.com/
>
> that implies similar:
>
> * In-core file times may not be properly rounded to on-disk
> precision, causing spurious file time changes when the cache is
> refreshed from disk. This was fixed for typical Unix file systems
> in kernel 2.6.11. The fix for CEPH, CIFS, NTFS, UFS and FUSE will
> be in kernel 4.3. There's no fix for FAT-based file systems yet.
>
> I also tested with CIFS on my system and it is fine. It looks like FAT
> systems were fixed since 2015. ;)
>
> But there is another interesting question raised there, which is how
> different implementations may interact (e.g., two versions of Git
> without and without USE_NSEC, or JGit which may have to use
> millisecond-resolution APIs, etc). It should all work correctly as long
> as each implementation consistently uses its own resolution (so JGit
> would have to compare in millisecond-space and treat ties as racy). And
> I think that is _probably_ what is happening now, since we already store
> nanoseconds unconditionally (and only use them with USE_NSEC).
>
> Though the opposite case is a performance problem but not a correctness
> one: if JGit writes out an index with milliseconds and USE_NSEC Git
> tries to read it, we will consider everything stat-dirty and re-read the
> contents.
>
> I don't know if these would be a problem in practice or not, but it's an
> interesting potential gotcha. And one that nobody may have noticed,
> because probably hardly anybody bothers to build with USE_NSEC now.
I would suggest that we provide a config knob and then build with
USE_NSEC by default. Most people are using Linux with typical Unix file
systems, NTFS, CIFS, or FUSE (e.g., sshfs). In the event someone
detects a problem, there's an easy solution—adjust the knob—and we can
then add a Linux-specific statfs call to determine if the file system is
a safe one in a future version.
--
brian m. carlson (they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]
prev parent reply other threads:[~2026-06-29 0:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-20 16:00 [PATCH] meson: wire up USE_NSEC build knob D. Ben Knoble
2026-06-21 1:01 ` Junio C Hamano
2026-06-21 16:41 ` D. Ben Knoble
2026-06-22 8:13 ` Patrick Steinhardt
2026-06-21 17:49 ` Jeff King
2026-06-22 8:13 ` Patrick Steinhardt
2026-06-28 8:18 ` Jeff King
2026-06-28 8:48 ` Jeff King
2026-06-29 0:23 ` brian m. carlson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=akG7AJxeiWc8KUYN@fruit.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=ben.knoble+github@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=ramsay@ramsayjones.plus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox