Re: [PATCH 01/11] x86: Fix vtime/file timestamp inconsistencies

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: john stultz
Date: Wednesday, July 14, 2010 - 9:19 am

On Wed, 2010-07-14 at 11:40 +0900, KOSAKI Motohiro wrote:

Correct,  filesystem timestamps and gettimeofday can still seem
inconsistently ordered. But that is expected.

Because of granularity differences (one interface is only tick
resolution, the other is clocksource resolution), we can't interleave
the two interfaces (time and gettimeofday, respectively) and expect to
get ordered results.

This is why the fix I'm proposing is important: Filesystem timestamps
have always been tick granular, so when vtime() was made clocksource
granular (by using vgettime internally) we broke the historic
expectation that the time() interface could be interleaved with
filesystem operations.

Side note: For full nanosecond resolution of the tick-granular
timestamps, check out the clock_gettime(CLOCK_REALTIME_COARSE, ...)
interface.



The only way to make gettimeofday and create consistent is to use
gettimeofday clocksource resolution timestamps for files. This however
would potentially cause a large performance hit, since each every file
timestamp would require a possibly expensive read of the clocksource.

thanks
-john


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/11] Implement timespec_add, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 03/11] time: Kill off CONFIG_GENERIC_TIME, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 04/11] powerpc: Simplify update_vsyscall, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 05/11] powerpc: Cleanup xtime usage, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 07/11] Convert um to use read_persistent_clock, John Stultz, (Tue Jul 13, 5:56 pm)
Re: [PATCH 01/11] x86: Fix vtime/file timestamp inconsiste ..., john stultz, (Wed Jul 14, 9:19 am)
[tip:timers/clocksource] x86: Fix vtime/file timestamp inc ..., tip-bot for John Stultz, (Tue Jul 27, 3:45 am)
[tip:timers/clocksource] time: Implement timespec_add, tip-bot for John Stultz, (Tue Jul 27, 3:46 am)
[tip:timers/clocksource] time: Kill off CONFIG_GENERIC_TIME, tip-bot for John Stultz, (Tue Jul 27, 3:46 am)
[tip:timers/clocksource] powerpc: Simplify update_vsyscall, tip-bot for John Stultz, (Tue Jul 27, 3:46 am)
[tip:timers/clocksource] powerpc: Cleanup xtime usage, tip-bot for John Stultz, (Tue Jul 27, 3:47 am)
[tip:timers/clocksource] timkeeping: Fix update_vsyscall t ..., tip-bot for John Stultz, (Tue Jul 27, 3:47 am)
[tip:timers/clocksource] um: Convert to use read_persisten ..., tip-bot for John Stultz, (Tue Jul 27, 3:47 am)
[tip:timers/clocksource] hrtimer: Cleanup direct access to ..., tip-bot for John Stultz, (Tue Jul 27, 3:48 am)
Re: [PATCH 04/11] powerpc: Simplify update_vsyscall, Paul Mackerras, (Tue Jul 27, 4:41 pm)
Re: [PATCH 04/11] powerpc: Simplify update_vsyscall, john stultz, (Tue Jul 27, 6:33 pm)