From: Corey Minyard <minyard@acm.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Andi Kleen <ak@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: Race betwen the NMI handler and the RTC clock in practially all kernels II
Date: Mon, 25 Oct 2004 17:04:31 -0500 [thread overview]
Message-ID: <417D786F.4020101@acm.org> (raw)
In-Reply-To: <Pine.LNX.4.58L.0410252157440.10974@blysk.ds.pg.gda.pl>
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
next prev parent reply other threads:[~2004-10-25 22:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <417D2305.3020209@acm.org.suse.lists.linux.kernel>
2004-10-25 19:44 ` Race betwen the NMI handler and the RTC clock in practially all kernels Andi Kleen
2004-10-25 19:50 ` Corey Minyard
2004-10-25 20:14 ` Andi Kleen
2004-10-25 20:15 ` linux-os
2004-10-25 20:07 ` Maciej W. Rozycki
2004-10-25 20:17 ` Andi Kleen
2004-10-25 20:41 ` Race betwen the NMI handler and the RTC clock in practially all kernels II Andi Kleen
2004-10-25 21:00 ` Maciej W. Rozycki
2004-10-25 22:04 ` Corey Minyard [this message]
2004-10-25 23:40 ` Maciej W. Rozycki
2004-10-26 2:50 ` Corey Minyard
2004-10-26 12:01 ` linux-os
2004-10-25 20:47 ` Race betwen the NMI handler and the RTC clock in practially all kernels Maciej W. Rozycki
2004-10-25 20:11 ` linux-os
2004-10-25 20:23 ` Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=417D786F.4020101@acm.org \
--to=minyard@acm.org \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.