public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: george@mvista.com
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] eliminte NMI entry/ exit code
Date: Fri, 12 Aug 2005 23:27:49 -0700	[thread overview]
Message-ID: <42FD92E5.4020407@vmware.com> (raw)
In-Reply-To: <42FD4942.8050407@mvista.com>

George Anzinger wrote:

> Nick Piggin wrote:
>
>> George Anzinger wrote:
>>
>>> The NMI entry and exit code fiddles with bits in the preempt count.  
>>> If an NMI happens while some other code is doing the same, bits will 
>>> be lost.  This patch removes this modify code from the NMI path till 
>>> we can come up with something better.
>>>
>>
>> Humour me for a minute here...
>> NMI restores preempt_count back to its old value upon exit, right?
>> So what does a race case look like?
>
>
> Normal code                   NMI
> fetch preempt_count
> add                   <-----  interrupt here add and store then 
> subtract and store, darn!
> store preempt_count
>
> Ok, no problem.
>
> The problem is in the RT code when PREEMPT_DEBUG is on.  The tests for 
> reasonable counts fail because of the rather undefined state when NMI 
> picks up the word.  The failure is on the NMI side... 


So NMI changing the preempt count and restoring in the middle of a RWM 
is not the problem.  Thus I don't understand what the issue is.  NMI 
must undo all side effects.  Does the PREEMPT_DEBUG code check the count 
somewhere within the NMI handler?  If so, shouldn't the proper fix be to 
make that code aware that it could be running inside of an NMI and/or 
ensure that code is not called from within the NMI handler?

Zach

  reply	other threads:[~2005-08-13  6:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-13  0:45 [PATCH] eliminte NMI entry/ exit code George Anzinger
2005-08-13  0:56 ` Nick Piggin
2005-08-13  1:13   ` George Anzinger
2005-08-13  6:27     ` Zachary Amsden [this message]
2005-08-13 16:54       ` George Anzinger
2005-08-13  1:18 ` Linus Torvalds

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=42FD92E5.4020407@vmware.com \
    --to=zach@vmware.com \
    --cc=akpm@osdl.org \
    --cc=george@mvista.com \
    --cc=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox