Re: [PATCH] eliminte NMI entry/ exit code

From: Linus Torvalds
Date: Fri Aug 12 2005 - 20:19:03 EST




On Fri, 12 Aug 2005, 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.

Why?

Even if an NMI happens in the middle of a read-modify-write sequence that
is critical, the NMI exit is supposed to undo whatever it was that the NMI
entry did, so the preempt counters are "safe" wrt NMI: they may change,
but they always change back by the time anybody cares.

This, btw, is something we depend on wrt _normal_ interrupts too. It's why
people can read/modify/write preempt count without having to disable
interrupts.

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