Re: Possible clocksource wrapping issues w/ new vdsoclock_gettime() code?

From: john stultz
Date: Mon Jul 23 2007 - 14:05:12 EST


On Mon, 2007-07-23 at 10:59 -0700, john stultz wrote:
> Hey Andi,
> I've not been able to review the new vdso code very carefully yet, but
> I noticed one thing right off: the offset calculation is not masked, so
> its possible w/ counters less then 64bits wide to have wrapping issues.

Here's another minor cleanup. Looks like wall_time_nsec is being set
twice.

diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index 06c3494..fc62608 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -80,7 +80,6 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec;
vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
vsyscall_gtod_data.sys_tz = sys_tz;
- vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic;
write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
}


Also, is there a reason why with the new __vdso_gettimeofday
implementation, the old do_vgettimeofday has not been removed?

thanks
-john


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/