lkml.org 
[lkml]   [2004]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Race betwen the NMI handler and the RTC clock in practially all kernels II
Maciej W. Rozycki wrote:

>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
>
>
If you look at my patch, it does create a shadow index.

And you need a mutex for SMP systems. If one processor is handling an
NMI, another processor may still be accessing the device.

The complexity comes because the claiming of the lock, the CPU that owns
the lock, and the index has to be atomic because the NMI handler has to
know all these things when the lock is claimed.

-Corey
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.179 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site