From: Tejun Heo <tj@kernel.org>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: peterz@infradead.org, tglx@linutronix.de, mingo@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
Subject: Re: [PATCH v3 2/2] CPU hotplug, stop-machine: Plug race-window that leads to "IPI-to-offline-CPU"
Date: Mon, 12 May 2014 16:57:57 -0400 [thread overview]
Message-ID: <20140512205757.GA18959@mtj.dyndns.org> (raw)
In-Reply-To: <20140511203657.17152.79234.stgit@srivatsabhat.in.ibm.com>
Hello,
On Mon, May 12, 2014 at 02:07:04AM +0530, Srivatsa S. Bhat wrote:
> @@ -189,10 +191,27 @@ static int multi_cpu_stop(void *data)
> do {
> /* Chill out and ensure we re-read multi_stop_state. */
> cpu_relax();
> +
> + /*
> + * In the case of CPU offline, we don't want the other CPUs to
> + * send IPIs to the active_cpu (the one going offline) after it
> + * has disabled interrupts in the _DISABLE_IRQ state (because,
> + * then it will notice the IPIs only after it goes offline). So
> + * we split this state into _INACTIVE and _ACTIVE, and thereby
> + * ensure that the active_cpu disables interrupts only after
> + * the other CPUs do the same thing.
> + */
It probably would be clearer to first describe what's going on and
then provide rationale for that. IOW, state that inactive cpus
disable irqs first and then explain why that's done. The above
paragraph looks somewhat out of place as is.
> +
> if (msdata->state != curstate) {
> curstate = msdata->state;
> switch (curstate) {
> - case MULTI_STOP_DISABLE_IRQ:
> + case MULTI_STOP_DISABLE_IRQ_INACTIVE:
> + if (is_active)
> + break;
> +
> + /* Else, fall-through */
> +
> + case MULTI_STOP_DISABLE_IRQ_ACTIVE:
Wouldn't it be cleaner to do the following?
case MULTI_STOP_DISABLE_IRQ_INACTIVE:
if (!is_active) {
disable;
}
break;
case MULTI_STOP_DISABLE_IRQ_ACTIVE:
if (is_active) {
disable;
}
break;
The duplicated amount is trivial and what's going on would be far
clearer.
Thanks.
--
tejun
next prev parent reply other threads:[~2014-05-12 20:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 20:36 [PATCH v3 0/2] CPU hotplug: Fix the long-standing "IPI to offline CPU" issue Srivatsa S. Bhat
2014-05-11 20:36 ` [PATCH v3 1/2] smp: Print more useful debug info upon receiving IPI on an offline CPU Srivatsa S. Bhat
2014-05-13 15:38 ` Frederic Weisbecker
2014-05-15 6:42 ` Srivatsa S. Bhat
2014-05-15 14:16 ` Frederic Weisbecker
2014-05-11 20:37 ` [PATCH v3 2/2] CPU hotplug, stop-machine: Plug race-window that leads to "IPI-to-offline-CPU" Srivatsa S. Bhat
2014-05-12 20:57 ` Tejun Heo [this message]
2014-05-13 9:02 ` [PATCH v4 " Srivatsa S. Bhat
2014-05-13 15:57 ` Frederic Weisbecker
2014-05-15 6:54 ` 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=20140512205757.GA18959@mtj.dyndns.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.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=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=rostedt@goodmis.org \
--cc=rusty@rustcorp.com.au \
--cc=srivatsa.bhat@linux.vnet.ibm.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
Powered by JetHome