Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Linux

Linux's Multi-Grain Timestamps Short-Lived: Removed From The Kernel After A Few Weeks (phoronix.com) 31

An anonymous reader shared this report from Phoronix: One of the new features merged for the Linux 6.6 kernel was multi-grained timestamps for the VFS layer and wiring it up for the EXT4, Btrfs, XFS, and Tmpfs file-systems. This alternative though to coarse-grained timestamps ended up exposing some problems and this week ahead of Linux 6.6-rc3, the feature has been stripped entirely from the kernel.

Multi-grain timestamps were intended for addressing cases where the current coarse-grained timestamps can be ineffective for updating creation/modification times with a lot of I/O potentially happening within the once per jiffy timestamp... Multi-grained timestamps though were only to be selectively enabled to avoid the performance overhead.

Christian Brauner of Microsoft who originally submitted the feature for Linux 6.6 went ahead and submitted the pull request, which has already been honored, for dropping the short-lived kernel feature... "As there are multiple solutions discussed the honest thing to do here is not to fix this up or disable it but to cleanly revert. The general infrastructure will probably come back but there is no reason to keep this code in mainline."

This discussion has been archived. No new comments can be posted.

Linux's Multi-Grain Timestamps Short-Lived: Removed From The Kernel After A Few Weeks

Comments Filter:
  • by Gravis Zero ( 934156 ) on Monday September 25, 2023 @08:39AM (#63875025)

    While discussing various fixes the decision was to go back to the drawing board and ultimately to explore a solution that involves only exposing such fine-grained timestamps to nfs internally and never to userspace.

    This is a real fix because it works for existing configurations. The fix here the multi-grain timestamp feature becomes superfluous which makes dropping it entirely the obvious choice from a code maintenance perspective.

    • So I'm wondering... Was the problem something like timestamp events being created with no context?
      • I've tried to comprehend this from multiple sources, but it sounds like maybe caching issues make it possible that a later timestamp change may be overwritten by an earlier one. Certainly with some kinds of files, like say database files which remain open and updated with some frequency, frequent updating of time stamps every time there is a change could create a lot of IO overhead. Even the implementation in question seems to rely on downtime to update timestamps, which means if a system becomes very busy,

      • "The kernel will elide fine-grain timestamp updates when no one is actively querying for them to avoid performance impacts. So a sequence like write(f1) stat(f2) write(f2) stat(f2) write(f1) stat(f1) may result in timestamp f1 to be older than the final f2 timestamp even though f1 was last written to but the second write didn't update the timestamp.

        Such plotholes can lead to subtle bugs when programs compare timestamps. For example, the nap() function will estimate that it needs to wait one ns on a fine-grain timestamp enabled filesytem between subsequent calls to observe a timestamp change. But in general we don't update timestamps with more than one jiffie if we think that no one is actively querying for fine-grain timestamps to avoid performance impacts.

  • multi-grain? (Score:2, Insightful)

    by Anonymous Coward
    I thought multi-grain was supposed to be good for you.
  • They still spew out crap code, but now they take it back all by themselves.

  • I gave the multigrain timestamps a try, but honestly, I prefer the whole-kernel ones - I'm glad they took them out.

    And don't get me started on my chip preferences.

  • As opposed to the 100% whole wheat timestamps.

Good day to avoid cops. Crawl to work.

Working...