Re: [RFC 1/3] Unified NMI delayed call mechanism

From: Ingo Molnar
Date: Sat Jun 19 2010 - 06:54:25 EST



( Ugh: what's this new fad of you not quoting the name of the person who
wrote a mail? It makes multi-level quotes utterly unreadable as it's not
clear who wrote what. You should also respect others by quoting their names. )

* Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

> > > we can use soft_irq as a backup of self interrupt (for systems without
> > > APIC and maybe for other architectures).
> >
> > Whatever would you want to do that for.
>
> The idea is that the work would be done latest on the next timer interrupt
> as a fallback if APIC is not available.

Abusing the timer irq for that is an exceedingly ugly and unacceptable design,
as machine check events have nothing to do with timers. (That approach is also
buggy because it inserts an arbitrary delay - which could be rather long on
nohz.)

This kind of messy, ad-hoc piggybacking only creates unmaintainable code in
the long run.

> That's what mce does already and it's probably approbiate for most other
> users too.

Hell no, the unfortunate and unclean practices of the MCE code must not be
propagated elsewhere.

The proper, generic approach would be to enable softirq notifications (on x86)
from NMI contexts as well (it's actually possible without overhead), and to
extend user return notifiers with the logical next step: nmi return notifiers.
If presented in such a form then those could use softirqs for atomic callbacks
and per cpu kthreads for sleepable callbacks, etc.

Ingo
--
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/