Re: Race betwen the NMI handler and the RTC clock in practially allkernels II

From: Maciej W. Rozycki
Date: Mon Oct 25 2004 - 16:20:51 EST


On Mon, 25 Oct 2004, Andi Kleen wrote:

> So it's impossible to check the old value. The original code is the only
> way to do this (if it's even needed, Intel also doesn't say anything
> about this bit being a flip-flop). Only possible change would be to
> write an alternative index.

You can't read the old value, but you can have a shadow variable written
every time the real index is written. Since NMIs are not preemptible and
this is a simple producer-consumer access, no mutex around accesses to the
variable is needed.

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