[lkml]   [2004]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Linux 2.6 nanosecond time stamp weirdness breaks GCC build
On Thu, Apr 01, 2004 at 10:09:57PM +0200, Andi Kleen wrote:

> just round up to the next second instead of rounding down when going
> from 1s resolution to ns.

Please don't do that. Longstanding tradition in timestamp code is to
truncate toward minus infinity when converting from a
higher-resolution timestamp to a lower-resolution timestamp. This
is consistent behavior, and is easy to explain: let's stick to it as a
uniform practice.

There are two basic principles here. First, ordinary files should not
change spontaneously: hence a file's timestamp should not change
merely because its inode is no longer cached. Second, a file's
timestamp should never be "in the future": hence one should never
round such timestamps up.

The only way I can see to satisfy these two principles is to truncate
the timestamp right away, when it is first put into the inode cache.
That way, the copy in main memory equals what will be put onto disk.
This is the approach taken by other operating systems like Solaris,
and it explains why parallel GCC builds won't have this problem on
these other systems.

Switching subjects slightly, in
I recently contributed code to coreutils that fixes some bugs with "cp
--update" and "mv --update" when files are copied from
high-resolution-timestamp file systems to low-resolution-timestamp
file systems. This code dynamically determines the timestamp
resolution of a file system by examining (and possibly mutating) its
timestamps. The current Linux+ext3 behavior (which I did not know
about) breaks this code, because it can cause "cp" to falsely think
that ext3 has nanosecond-resolution timestamps.

How long has the current Linux+ext3 behavior been in place? If it's
widespread, I'll probably have to think about adding a workaround to
coreutils. Does the behavior affect all Linux filesystems, or just

I'll CC: this message to bug-coreutils to give them a heads-up.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:02    [W:0.151 / U:35.136 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site