2002-10-25 01:16:01

by Corey Minyard

[permalink] [raw]
Subject: [PATCH] NMI request/release, version 6 - "Well I thought the last one was ready"

Ok, I have reworked all the NMI code, moved it to it's own file, and
converted all the NMI users to use the NMI request/release code. The
current code will call call the NMI handlers on an NMI, interested
parties may detect that their NMI occurred and handle it. Since the NMI
into the CPU is edge-triggered, I think that's the correct way to handle
it (although it is slower). If someone figures out another way, that
would be very helpful. The include/linux/nmi.h and
arch/i386/kernel/nmi.c files were renamed to nmi_watchdog.h and
nmi_watchdog.c.

The biggest hole (that I know of) in these changes is that there is no
way that I can tell to detect if an nmi_watchdog has occurred if the NMI
source is the I/O APIC. That code will assume that if no one else has
handled the NMI, it was the source, which is a bad assumption (but the
same assumption that was being made before my changes, so it's no
worse). Most things should be using the local APIC, anyway.

It's now too big to include in an email, so it's at
http://home.attbi.com/~minyard/linux-nmi-v6.diff.

-Corey


2002-10-25 01:33:46

by John Levon

[permalink] [raw]
Subject: Re: [PATCH] NMI request/release, version 6 - "Well I thought the last one was ready"

On Thu, Oct 24, 2002 at 08:22:33PM -0500, Corey Minyard wrote:

> http://home.attbi.com/~minyard/linux-nmi-v6.diff.

case NOTIFY_DONE:
default:
}

This needs to be :

case NOTIFY_DONE:
default:;
}

or later gcc's whine.

+ * handler, if you have a fast-path handler there's another tie-in
+ * for you. See the oprofile code.

You forgot to remove this comment.

if (!list_empty(&(handler->link)))
return EBUSY;

This wants to be -EBUSY (it eventually gets returned to userspace via
oprofile, and is more common anyway).

static int nmi_std (void * dev_id,
struct pt_regs * regs,
int cpu,
int handled)

I don't think this matches the usual kernel style.

I think the rest looks OK, I'll find some time to play with oprofile
side of this.

thanks
john

--
"This is playing, not work, therefore it's not a waste of time."
- Zath

2002-10-25 01:52:23

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] NMI request/release, version 6 - "Well I thought the last one was ready"

John Levon wrote:

>On Thu, Oct 24, 2002 at 08:22:33PM -0500, Corey Minyard wrote:
>
>
>
>>http://home.attbi.com/~minyard/linux-nmi-v6.diff.
>>
>>
>
> case NOTIFY_DONE:
> default:
> }
>
>This needs to be :
>
> case NOTIFY_DONE:
> default:;
> }
>
>or later gcc's whine.
>
or the even-more-readable:

default: /* do nothing */
break;