public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Time nonlinearity (gettimeofday vs. mtime)
@ 2009-11-27 13:31 Matthias Urlichs
  2009-11-27 14:18 ` Andi Kleen
  2009-12-01  0:12 ` john stultz
  0 siblings, 2 replies; 3+ messages in thread
From: Matthias Urlichs @ 2009-11-27 13:31 UTC (permalink / raw)
  To: linux-kernel

Lately I've seen this ugliness:

13:39:06.000313 clock_gettime(CLOCK_REALTIME, {1259325546, 341196}) = 0 <0.000010>
13:39:06.000685 mkdir("/var/tmp/CP_FileTest_TempFolder_d0AOiP/tempFolder1", 0777) = 0 <0.000043>
13:39:06.000973 stat64("/var/tmp/CP_FileTest_TempFolder_d0AOiP/tempFolder1", {st_dev=makedev(252, 2), st_ino=1919104, st_mode=S_IFDIR|0755, st_nlink=2, st_uid=501, st_gid=501, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2009/11/27-13:39:05, st_mtime=2009/11/27-13:39:05, st_ctime=2009/11/27-13:39:05}) = 0 <0.000015>

This strace says that st.st_mtime is smaller than time.tv_sec even though the time was acquired earlier.
Apparently, the problem is that ext3 uses a cached time value for performance.

Question: Is there a reason that the cached time is not updated every time somebody calls gettimeofday() or clock_gettime()?
Or did just that nobody notice this problem yet?





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-01  0:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-27 13:31 Time nonlinearity (gettimeofday vs. mtime) Matthias Urlichs
2009-11-27 14:18 ` Andi Kleen
2009-12-01  0:12 ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox