Re: [PATCH 3/5] irq_work: Implement remote queueing

From: Peter Zijlstra
Date: Tue Jun 03 2014 - 12:56:21 EST


On Tue, Jun 03, 2014 at 09:29:07AM -0700, Eric Dumazet wrote:
> > +bool irq_work_queue_on(struct irq_work *work, int cpu)
> > +{
> > + /* All work should have been flushed before going offline */
> > + WARN_ON_ONCE(cpu_is_offline(cpu));
> > +
> > + /* Arch remote IPI send/receive backend aren't NMI safe */
> > + WARN_ON_ONCE(in_nmi());
> > +
> > + /* Only queue if not already pending */
> > + if (!irq_work_claim(work))
> > + return false;
> > +
> > + if (llist_add(&work->llnode, &per_cpu(raised_list, cpu)))
> > + native_send_call_func_single_ipi(cpu);
> > +
> > + return true;
> > +}
> > +EXPORT_SYMBOL_GPL(irq_work_queue_on);
> > +
>
> I am curious, this should only compile on x86, right ?

Oh, you tease, you forgot to say why you think this.

Are you referring to the in_nmi() usage? that's from
include/linux/hardirq.h, hardly x86 specific.

Attachment: pgpBvGAIS_DBm.pgp
Description: PGP signature