Rethinking multi-grain timestamps
Rethinking multi-grain timestamps
Posted Oct 9, 2023 17:38 UTC (Mon) by jlayton (subscriber, #31672)Parent article: Rethinking multi-grain timestamps
This set is probably also defunct, as it means that you could use utimensat() to set a timestamp and then not get the same value back when you fetched it. My current approach is to try to advance the apparent coarse grained time whenever a fine grained time is handed out. That should mitigate the problem of seeing out-of-order timestamps that Jon descrbed. This is a major rework though, and probably won't be ready for v6.7.
Posted Oct 10, 2023 15:47 UTC (Tue)
by nim-nim (subscriber, #34454)
[Link] (5 responses)
Posted Oct 10, 2023 22:24 UTC (Tue)
by jlayton (subscriber, #31672)
[Link] (4 responses)
Whenever we stamp a file with a fine-grained timestamp, that time will now become the floor for any further timestamp that is handed out. The revised draft I have of this series works, and it now passes the testcase that was failing before, but it's still quite rough and needs further testing.
Posted Oct 11, 2023 7:52 UTC (Wed)
by nim-nim (subscriber, #34454)
[Link] (3 responses)
But won’t that make any file which timestamp is read after the fine-grained timestamp, newer than files which timestamp has been read before, even though in coarse timestamp world they would have the same timestamp, and may have even been written in a different order ?
Posted Oct 11, 2023 10:25 UTC (Wed)
by jlayton (subscriber, #31672)
[Link] (2 responses)
Basically, when we go to update any of the inode's timestamps we'll always grab the coarse-grained timestamp in the kernel for the update, unless someone has viewed it recently, in which case we'll grab a fine-grained timestamp instead. The idea is to update the coarse grained timestamp whenever we hand out a fine-grained one. That avoids the problem described in the article where the timestamps on files updated later appear to be earlier than the fine grained update.
That does make issuing a fine-grained timestamp a bit more expensive though, so some of my current effort is in trying to improve that, and minimizing the number of fine-grained updates that are needed.
Posted Oct 11, 2023 22:55 UTC (Wed)
by nijhof (subscriber, #4034)
[Link] (1 responses)
Posted Oct 11, 2023 23:18 UTC (Wed)
by jlayton (subscriber, #31672)
[Link]
So to answer your question, there should be no problem. The idea is to update the apparent coarse-grained timestamp _source_ before returning any fine-grained timestamp. Any later fetch from the timestamp source (coarse or fine), will always be later than or equal to the last fine grained timestamp handed out. That should be good enough to keep "make" happy.
(Note that it's a bit more complex with the way that times are tracked in the timekeeping code, so I'm glossing over some details here.)
Rethinking multi-grain timestamps
Rethinking multi-grain timestamps
Rethinking multi-grain timestamps
Rethinking multi-grain timestamps
Rethinking multi-grain timestamps
Rethinking multi-grain timestamps