From: Corey Minyard <cminyard@mvista.com>
To: John Levon <levon@movementarian.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NMI request/release
Date: Mon, 21 Oct 2002 21:32:07 -0500 [thread overview]
Message-ID: <3DB4B8A7.5060807@mvista.com> (raw)
In-Reply-To: 20021022021005.GA39792@compsoc.man.ac.uk
John Levon wrote:
>On Mon, Oct 21, 2002 at 08:32:47PM -0500, Corey Minyard wrote:
>
>>The attached patch implements a way to request to receive an NMI if it
>>comes from an otherwise unknown source. I needed this for handling NMIs
>>with the IPMI watchdog. This function was discussed a little a while
>>
>>
>Then NMI watchdog and oprofile should be changed to use this too.
>
Maybe so. If we get the infrastructure into place, we can change that
afterwards.
> We
>also need priority and/or equivalent of NOTIFY_STOP_MASK so we can break
>out of calling all the handlers. Actually, why do you continue if one
>of the handlers returns 1 anyway ?
>
What if there's an NMI from multiple things? Not that it's likely, but
it's possible, right? I could easily add priority and sort the list by
it, and add a NOTIFY_STOP_MASK, if there is some benefit.
>>+ atomic_inc(&calling_nmi_handlers);
>>
>>
>Isn't this going to cause cacheline ping pong ?
>
This is an NMI, does it really matter? And is there another way to do
this without locks?
>>+ curr = nmi_handler_list;
>>+ while (curr) {
>>+ handled |= curr->handler(curr->dev_id, regs);
>>
>>
>dev_name is never used at all. What is it for ? Also, would be nice
>to do an smp_processor_id() just once and pass that in to prevent
>multiple calls to get_current().
>
dev_name could be removed, although it would be nice for reporting
later. Basically, for the same reason it's there for interrupts. And
again, this is an NMI, I don't think performance really matters (unless
we perhaps add the NMI watchdog to this).
>Couldn't you modify the notifier code to do the xchg()s (though that's
>not available on all CPU types ...)
>
I don't understand. The xchg()s are for atomicity between the
request/release code and the NMI handler. How could the notifier code
do it?
>>+#define HAVE_NMI_HANDLER 1
>>
>>
>What uses this ?
>
This is so the user code can know if it's available or not.
>>+ volatile struct nmi_handler *next;
>>
>>
>Hmm ...
>
>Is it not possible to use linux/rcupdate.h for this stuff ?
>
I'm not sure. It looks possible, but remember, this is an NMI, normal
rules may not apply. Particularly, you cannot block or spin waiting for
something else, the NMI code has to run. An NMI can happen at ANY time.
If the rcu code can handle this, I could use it, but I have not looked
to see if it can.
Thanks,
-Corey
next prev parent reply other threads:[~2002-10-22 2:25 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-22 1:32 [PATCH] NMI request/release Corey Minyard
2002-10-22 2:10 ` John Levon
2002-10-22 2:32 ` Corey Minyard [this message]
2002-10-22 2:53 ` John Levon
2002-10-22 13:02 ` Corey Minyard
2002-10-22 15:09 ` John Levon
2002-10-22 16:03 ` Corey Minyard
2002-10-22 17:23 ` Robert Love
2002-10-22 18:08 ` Corey Minyard
2002-10-22 18:16 ` Robert Love
2002-10-22 20:04 ` Dipankar Sarma
2002-10-22 17:53 ` Dipankar Sarma
2002-10-22 18:05 ` Corey Minyard
2002-10-22 18:08 ` Dipankar Sarma
2002-10-22 18:29 ` Corey Minyard
2002-10-22 19:08 ` John Levon
2002-10-22 21:36 ` [PATCH] NMI request/release, version 3 Corey Minyard
2002-10-23 17:33 ` Dipankar Sarma
2002-10-23 18:03 ` Corey Minyard
2002-10-23 18:57 ` Dipankar Sarma
2002-10-23 20:14 ` [PATCH] NMI request/release, version 4 Corey Minyard
2002-10-23 20:50 ` Dipankar Sarma
2002-10-23 21:53 ` Corey Minyard
2002-10-24 7:41 ` Dipankar Sarma
2002-10-24 13:08 ` Corey Minyard
2002-10-24 7:50 ` Dipankar Sarma
2002-10-24 13:05 ` Corey Minyard
2002-10-24 13:28 ` [PATCH] NMI request/release, version 5 - I think this one's ready Corey Minyard
2002-10-24 14:46 ` John Levon
2002-10-24 15:36 ` Corey Minyard
2002-10-24 17:18 ` John Levon
2002-10-24 17:43 ` Corey Minyard
2002-10-24 18:04 ` John Levon
2002-10-24 18:32 ` Corey Minyard
2002-10-24 18:47 ` John Levon
2002-10-24 20:03 ` Corey Minyard
2002-10-24 20:29 ` John Levon
2002-10-25 1:22 ` [PATCH] NMI request/release, version 6 - "Well I thought the last one was ready" Corey Minyard
2002-10-25 1:39 ` John Levon
2002-10-25 1:58 ` Jeff Garzik
2002-10-25 2:01 ` [PATCH] NMI request/release, version 7 - minor cleanups Corey Minyard
2002-10-25 13:26 ` [PATCH] NMI request/release, version 8 Corey Minyard
2002-10-22 12:23 ` [PATCH] NMI request/release Suparna Bhattacharya
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=3DB4B8A7.5060807@mvista.com \
--to=cminyard@mvista.com \
--cc=levon@movementarian.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).