Re: [PATCH] time: Add locking to xtime access in get_seconds()

Andi Kleen
2011-05-04T03:52:58Z

John Stultz <john.stultz@linaro.org> writes:

> From: John Stultz <johnstul@us.ibm.com>
>
> So get_seconds() has always been lock free, with the assumption
> that accessing a long will be atomic.
>
> However, recently I came across an odd bug where time() access could
> occasionally be inconsistent, but only on power7 hardware. The

Shouldn't a single rmb() be enough to avoid that?

If not then I suspect there's a lot more code buggy on that CPU than
just the time.

-Andi

--
ak@linux.intel.com -- Speaking for myself only