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

From: Andi Kleen
Date: Tue May 03 2011 - 23:53:01 EST


John Stultz <john.stultz@xxxxxxxxxx> writes:

> From: John Stultz <johnstul@xxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxxx -- Speaking for myself only
--
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/