public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: tglx@linutronix.de, mingo@kernel.org, tj@kernel.org,
	rusty@rustcorp.com.au, akpm@linux-foundation.org,
	fweisbec@gmail.com, hch@infradead.org, mgorman@suse.de,
	riel@redhat.com, bp@suse.de, rostedt@goodmis.org,
	mgalbraith@suse.de, ego@linux.vnet.ibm.com,
	paulmck@linux.vnet.ibm.com, oleg@redhat.com, rjw@rjwysocki.net,
	linux-kernel@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH v6 2/3] CPU hotplug, stop-machine: Plug race-window that leads to "IPI-to-offline-CPU"
Date: Fri, 23 May 2014 21:01:03 +0530	[thread overview]
Message-ID: <537F69B7.20002@linux.vnet.ibm.com> (raw)
In-Reply-To: <20140523152145.GF30445@twins.programming.kicks-ass.net>

On 05/23/2014 08:51 PM, Peter Zijlstra wrote:
> On Fri, May 23, 2014 at 03:42:20PM +0530, Srivatsa S. Bhat wrote:
>>        Re-enable interrupts                          Re-enable interrupts
>>
>>                                                      The pending IPI is noted
>>                                                      immediately, but alas,
>>                                                      the CPU is offline at
>>                                                      this point.
>>
> 
> So wasn't clear_local_APIC() (and the arch function __cpu_disable() in
> general) wipe all pending interrup state?
> 

Apparently not. Atleast powerpc explicitly re-enables only the IPIs.. 

A snippet from xics_migrate_irqs_away() in powerpc, which is called
in the cpu-disable phase:


/* Interrupts are disabled. */
void xics_migrate_irqs_away(void)
{
	[...]
	/* Reject any interrupt that was queued to us... */
	icp_ops->set_priority(0);

	[...]
	/* Allow IPIs again... */
	icp_ops->set_priority(DEFAULT_PRIORITY);

	for_each_irq_desc(virq, desc) {
		[...]
		/* We only need to migrate enabled IRQS */
		if (!desc->action)
			continue;

		[...]

		/* We need to get IPIs still. */
		if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
			continue;
		[...]

}

But that said, it should have cleared any pending IPIs and allowed
only *new* IPIs (for whatever reason). Atleast the warning I hit
indicates that that didn't happen, and the old IPI really was taken
later.

Ben, Paul, any thoughts on this?

Regards,
Srivatsa S. Bhat


  reply	other threads:[~2014-05-23 15:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 10:11 [PATCH v6 0/3] CPU hotplug: Fix the long-standing "IPI to offline CPU" issue Srivatsa S. Bhat
2014-05-23 10:12 ` [PATCH v6 1/3] smp: Print more useful debug info upon receiving IPI on an offline CPU Srivatsa S. Bhat
2014-05-23 10:12 ` [PATCH v6 2/3] CPU hotplug, stop-machine: Plug race-window that leads to "IPI-to-offline-CPU" Srivatsa S. Bhat
2014-05-23 13:22   ` Frederic Weisbecker
2014-05-23 14:45     ` Srivatsa S. Bhat
2014-05-23 15:04       ` Frederic Weisbecker
2014-05-23 15:24         ` Srivatsa S. Bhat
2014-05-23 15:12       ` Peter Zijlstra
2014-05-23 15:18         ` Srivatsa S. Bhat
2014-05-23 15:31           ` Peter Zijlstra
2014-05-23 15:33             ` Srivatsa S. Bhat
2014-05-23 15:37               ` Srivatsa S. Bhat
2014-05-23 15:48                 ` Peter Zijlstra
2014-05-23 15:53                   ` Srivatsa S. Bhat
2014-05-23 17:05                     ` Srivatsa S. Bhat
2014-05-23 15:21   ` Peter Zijlstra
2014-05-23 15:31     ` Srivatsa S. Bhat [this message]
2014-05-23 10:12 ` [PATCH v6 3/3] CPU hotplug, smp: Flush any pending IPI callbacks before CPU offline Srivatsa S. Bhat
2014-05-23 13:27   ` Frederic Weisbecker
2014-05-23 14:47     ` Srivatsa S. Bhat

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=537F69B7.20002@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=bp@suse.de \
    --cc=ego@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgalbraith@suse.de \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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