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

From: Andi Kleen
Date: Wed May 04 2011 - 17:05:49 EST


Max Asbock <masbock@xxxxxxxxxxxxxxxxxx> writes:

> On Tue, 2011-05-03 at 20:11 -0700, John Stultz wrote:
>> From: John Stultz <johnstul@xxxxxxxxxx>
>>
>> So get_seconds() has always been lock free, with the assumption
>> that accessing a long will be atomic.
>>
>
> get_seconds() is used in the x86 machine check handler and there is a
> comment saying:
> /* We hope get_seconds stays lockless */
>
> This needs to be carefully looked at if locking is introduced to
> get_seconds().

Yes the seqlock being interrupted by an MCE would deadlock.

-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/