lkml.org 
[lkml]   [2006]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Fix next_timer_interrupt() for hrtimer
From
Date
On Thu, 2006-02-23 at 16:40 -0800, Tony Lindgren wrote:
> * john stultz <johnstul@us.ibm.com> [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.

Do you intend instead to add xtime to tv?

thanks
-john


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

\
 
 \ /
  Last update: 2006-02-24 01:52    [W:0.039 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site