Re: [PATCH] [4/7] oprofile - NMI hook

Andi Kleen (ak@muc.de)
Wed, 16 Oct 2002 01:18:22 +0200


On Wed, Oct 16, 2002 at 01:01:06AM +0200, John Levon wrote:
> On Wed, Oct 16, 2002 at 12:56:28AM +0200, Andi Kleen wrote:
>
> > > This patch provides a simple api to let oprofile hook into
> > > the NMI interrupt for the perfctr profiler.
> >
> > I would suggest using a notifier list instead (include/linux/notifier.h)
> > This would handle multiple users cleanly.
>
> How ? The only safe way I can see would be to spin lock around the NMI
> (and try lock when an NMI arrives). This would either make every NMI
> contend on a single spinlock, or require a NR_CPUS-sized array of
> spinlocks, which is just ugly. And that wouldn't solve the
> power-management problem - any NMI users need to collaborate to disable
> NMI generation on a suspend.

The locking issues could be fixed with read-copy-update, but you're
right that it's not a good solution right now. I take the objection
back then.

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