On Tue, May 10, 2011 at 12:18:02PM -0700, john stultz wrote:
> On Mon, 2011-05-09 at 13:40 -0700, Greg KH wrote:
> > On Fri, May 06, 2011 at 09:08:34AM +0200, Andi Kleen wrote:
> > > > @@ -168,8 +168,13 @@ int __read_mostly timekeeping_suspended;
> > > >  static struct timespec xtime_cache __attribute__ ((aligned (16)));
> > > >  void update_xtime_cache(u64 nsec)
> > > >  {
> > > > -       xtime_cache = xtime;
> > > > -       timespec_add_ns(&xtime_cache, nsec);
> > > > +       /*
> > > > +        * Use temporary variable so get_seconds() cannot catch
> > > > +        * an intermediate xtime_cache.tv_sec value.
> > > > +        */
> > > > +       struct timespec ts = xtime;
> > > > +       timespec_add_ns(&ts, nsec);
> > > 
> > > There's nothing to stop the compiler's optimizer to use memory accesses
> > > directly again. Something similar to ACCESS_ONCE (that is essentially a 
> > > volatile cast) may be required to be fully future proof.
> > 
> > I agree, this doesn't look like a viable solution at all.
> 
> So does something like this look better? I'm really not that familiar
> with how ACCESS_ONCE is to be used, so forgive me if I'm not using it
> correctly.
> 
> Signed-off-by: John Stultz <[email protected]>

Ok, now care to resend this, with the proper changelog header and the
acks you've accumulated, so that I can apply this to the .32-stable
tree?

thanks,

greg k-h

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to