* john stultz [060223 16:50]: > On Thu, 2006-02-23 at 16:40 -0800, Tony Lindgren wrote: > > * john stultz [060223 16:37]: > > > On Thu, 2006-02-23 at 16:26 -0800, Tony Lindgren wrote: > > > > + tv = ktime_to_timespec(event); > > > > + > > > > + /* Assume read xtime_lock is held, so we can't use getnstimeofday() */ > > > > + sec = xtime.tv_sec; > > > > + nsec = xtime.tv_nsec; > > > > + while (unlikely(nsec >= NSEC_PER_SEC)) { > > > > + nsec -= NSEC_PER_SEC; > > > > + ++sec; > > > > + } > > > > + tv.tv_sec = sec; > > > > + tv.tv_nsec = nsec; > > > > > > Er, I think you should be able to nest readers. Thus getnstimeofday() > > > should be safe to call. Or is the comment wrong and you are assuming a > > > write lock is held? > > > > Oops, it's a write lock as next_timer_interrupt gets called from > > arch/*/time.c. > > Also the above code just overwrites tv. That's a bug from clean-up... Actually I just shrunk the ktime_to_jiffies(), see below. > Do you intend instead to add xtime to tv? No, just get current time in ktime. But turns out tv is not needed at all :) Tony