Re: Perhaps a side effect regarding NMI returns

From: Peter Zijlstra
Date: Wed Nov 30 2011 - 06:56:33 EST


On Tue, 2011-11-29 at 17:51 -0500, Steven Rostedt wrote:
> static void run_sync(void)
> {
> int enable_irqs = irqs_disabled();
>
> /* We may be called with interrupts disbled. */
> if (enable_irqs)
> local_irq_enable();
> on_each_cpu(do_sync_core, NULL, 1);
> if (enable_irqs)
> local_irq_disable();
> }
>
> Note, it's fine to enable interrupts here, it's only used by ftrace.

Still ugly as hell though, why not push that pain to the caller?
--
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/