git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] meson: wire up USE_NSEC build knob

From
D. Ben Knoble <ben.knoble+github@gmail.com>
Date
Jul 3, 2026, 15:46 UTC
Message-ID
<CALnO6CDAG4e4A_Qn-3QVe0s4D9xB333Sp0QRntNATwMygNXmQg@mail.gmail.com>
In-Reply-To
<ajjuoS5Qc3K0nCRl@pks.im>

[with apologies for the delay; I wasn't paying attention to "What's cooking" to notice that this was waiting on my response.]

On Mon, Jun 22, 2026 at 4:13 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 9 quoted lines
>
> On Sun, Jun 21, 2026 at 01:49:34PM -0400, Jeff King wrote:
> > On Sat, Jun 20, 2026 at 12:00:24PM -0400, D. Ben Knoble wrote:
> >
> > > Autotools-style builds permit enabling USE_NSEC for cases where that's
> > > desired; the equivalent knob is missing from meson-based builds.
> >
> > Seems reasonable. This is not changing the defaults at all, but just
> > bringing meson's options to parity with the Makefile.

For now, I still think this makes me in favor of the patch: source distributions like Gentoo can then offer the build knob for those who, in Junio's words

> know the target box with its filesystems happen to be OK with the option

Otherwise, the discussion would suggest removing it from Makefile as an option :)

Show 43 quoted lines
> I was originally wondering whether I should recommend that Meson can
> auto-discover the availability of nanoseconds. But your below remarks
> make me question that.
>
> > I'm not still not sure if turning on USE_NSEC is a good idea. There's
> > some discussion in Documentation/technical/racy-git.adoc:
> >
> >   With `USE_NSEC`
> >   compile-time option, `st_mtim.tv_nsec` and `st_ctim.tv_nsec`
> >   members are also compared. On Linux, this is not enabled by default
> >   because in-core timestamps can have finer granularity than
> >   on-disk timestamps, resulting in meaningless changes when an
> >   inode is evicted from the inode cache.  See commit 8ce13b0
> >   of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
> >   ([PATCH] Sync in core time granularity with filesystems,
> >   2005-01-04). This patch is included in kernel 2.6.11 and newer, but
> >   only fixes the issue for file systems with exactly 1 ns or 1 s
> >   resolution. Other file systems are still broken in current Linux
> >   kernels (e.g. CEPH, CIFS, NTFS, UDF), see
> >   https://lore.kernel.org/lkml/5577240D.7020309@gmail.com/
> >
> > That's the most succinct description of the problem I've seen, but I
> > have no idea how widely it still applies. Kernel 2.6.11 is quite old
> > now, but I could believe that other filesystems (especially network
> > ones) still exhibit the issue.
> >
> > So I guess if we wanted to go further it would take some digging as to
> > how each platform behaves, and then flipping the config.make.uname knob
> > for ones where it can be argued that the behavior is always reasonable.
>
> Yeah, it would be nice indeed to figure out whether these concerns still
> apply. If they do, I would argue that it might even make sense to remove
> the build option completely. It doesn't really make sense in my opinion
> to have a build option that nobody uses and that is subtly broken when
> enabled.
>
> > But that's all outside the scope of your patch here.
>
> Kind of, I guess. If we figure that this mechanism is still subtly broken
> then I'd argue that it doesn't make sense to expose the option via
> Meson.
>
> Patrick
This bit addressed more down-thread, so I'll reply there.

To summarize: If we're all leaning in the direction of a run-time flag instead, I can noodle in that direction. That certainly involves a bit more surgery than just giving Meson access to the option, but the dynamism may be nice. I'm not too sure how we'd write a test case for it, though.

Previous: D. Ben KnobleNext: Patrick Steinhardt
Message 15 of 19 in “meson: wire up USE_NSEC build knob”
  1. meson: wire up USE_NSEC build knobD. Ben Knoble, Jun 20, 2026
  2. Junio C HamanoJun 21, 2026
  3. D. Ben KnobleJun 21, 2026
  4. Patrick SteinhardtJun 22, 2026
  5. Jeff KingJun 21, 2026
  6. Patrick SteinhardtJun 22, 2026
  7. Jeff KingJun 28, 2026
  8. Jeff KingJun 28, 2026
  9. brian m. carlsonJun 29, 2026
  10. Patrick SteinhardtJun 29, 2026
  11. Junio C HamanoJun 29, 2026
  12. Jeff KingJun 30, 2026
  13. D. Ben KnobleJul 3, 2026
  14. D. Ben KnobleJul 3, 2026
  15. D. Ben KnobleJul 3, 2026
  16. Patrick SteinhardtJul 6, 2026
  17. Jeff KingJul 7, 2026
  18. Junio C HamanoJul 11, 2026
  19. Ben KnobleJul 13, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.