LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>,
	Nicholas Piggin <npiggin@gmail.com>
Cc: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Suraj Jitindar Singh" <sjitindarsingh@gmail.com>,
	"Frederic Weisbecker" <fweisbec@gmail.com>,
	qemu-ppc@nongnu.org, tglx@linutronix.de,
	linuxppc-dev@lists.ozlabs.org,
	"David? Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()
Date: Sat, 6 Apr 2019 02:06:12 +0200	[thread overview]
Message-ID: <20190406000611.GA27782@lenoir> (raw)
In-Reply-To: <20190401083827.GE11158@hirez.programming.kicks-ass.net>

On Mon, Apr 01, 2019 at 10:38:27AM +0200, Peter Zijlstra wrote:
> 
> + fweisbec, who did the remote bits
> 
> On Sat, Mar 30, 2019 at 01:10:28PM +1000, Nicholas Piggin wrote:
> > diff --git a/kernel/irq_work.c b/kernel/irq_work.c
> > index 6b7cdf17ccf8..f0e539d0f879 100644
> > --- a/kernel/irq_work.c
> > +++ b/kernel/irq_work.c
> > -/* Enqueue the irq work @work on the current CPU */
> > -bool irq_work_queue(struct irq_work *work)
> > +/*
> > + * Enqueue the irq_work @work on @cpu unless it's already pending
> > + * somewhere.
> > + *
> > + * Can be re-enqueued while the callback is still in progress.
> > + */
> > +bool irq_work_queue_on(struct irq_work *work, int cpu)
> >  {
> > +#ifndef CONFIG_SMP
> > +	return irq_work_queue(work);
> > +

I'd suggest to use "if (!IS_ENABLED(CONFIG_SMP))" here to avoid the large
ifdeffery.

> > +#else /* #ifndef CONFIG_SMP */
> > +	/* All work should have been flushed before going offline */
> > +	WARN_ON_ONCE(cpu_is_offline(cpu));
> > +
> >  	/* Only queue if not already pending */
> >  	if (!irq_work_claim(work))
> >  		return false;
> >  
> > -	/* Queue the entry and raise the IPI if needed. */
> >  	preempt_disable();
> > -
> > -	/* If the work is "lazy", handle it from next tick if any */
> > -	if (work->flags & IRQ_WORK_LAZY) {
> > -		if (llist_add(&work->llnode, this_cpu_ptr(&lazy_list)) &&
> > -		    tick_nohz_tick_stopped())
> > -			arch_irq_work_raise();
> > -	} else {
> > -		if (llist_add(&work->llnode, this_cpu_ptr(&raised_list)))
> > -			arch_irq_work_raise();
> > -	}
> > -
> > +	if (cpu != smp_processor_id()) {
> > +		/* Arch remote IPI send/receive backend aren't NMI safe */
> > +		WARN_ON_ONCE(in_nmi());
> > +		if (llist_add(&work->llnode, &per_cpu(raised_list, cpu)))
> > +			arch_send_call_function_single_ipi(cpu);
> > +	} else
> > +		__irq_work_queue(work);

Also perhaps rename __irq_work_queue() to irq_work_queue_local() to make it
instantly clearer to reviewers.

Other than those cosmetic changes,

  Reviewed-by: Frederic Weisbecker <frederic@kernel.org>

Thanks.

  parent reply	other threads:[~2019-04-06  0:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 12:36 pseries on qemu-system-ppc64le crashes in doorbell_core_ipi() Sebastian Andrzej Siewior
2019-03-27 16:37 ` [Qemu-ppc] " Cédric Le Goater
2019-03-27 16:51   ` Cédric Le Goater
2019-03-29  5:20     ` Suraj Jitindar Singh
2019-03-29  8:32       ` Sebastian Andrzej Siewior
2019-03-29  9:13       ` Nicholas Piggin
2019-03-29 15:31         ` Steven Rostedt
2019-03-30  3:10           ` Nicholas Piggin
2019-04-01  8:38             ` Peter Zijlstra
2019-04-04 16:25               ` Nicholas Piggin
2019-04-05 14:47                 ` Sebastian Andrzej Siewior
2019-04-06  0:06               ` Frederic Weisbecker [this message]
2019-04-09  9:25                 ` Nicholas Piggin
2019-12-19 10:41                   ` Jason A. Donenfeld
2019-12-19 11:13                     ` Sebastian Andrzej Siewior
2019-12-19 11:19                       ` Jason A. Donenfeld
2019-12-19 12:45                     ` Michael Ellerman
2019-12-19 13:08                       ` Cédric Le Goater
2019-12-20  0:22                         ` David? Gibson
2019-12-20 11:32                         ` Jason A. Donenfeld
2019-12-20 12:21                           ` David? Gibson
2019-12-20 15:59                           ` Cédric Le Goater
2019-12-20  0:53                       ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190406000611.GA27782@lenoir \
    --to=frederic@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=fweisbec@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rostedt@goodmis.org \
    --cc=sjitindarsingh@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox