mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"mm-commits@vger.kernel.org" <mm-commits@vger.kernel.org>,
	"jens.axboe@oracle.com" <jens.axboe@oracle.com>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"nickpiggin@yahoo.com.au" <nickpiggin@yahoo.com.au>,
	"rusty@rustcorp.com.au" <rusty@rustcorp.com.au>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: + generic-ipi-fix-the-race-between-generic_smp_call_function_-and-hotplug_cfd.patch added to -mm tree
Date: Tue, 15 Sep 2009 19:20:02 -0700	[thread overview]
Message-ID: <1253067602.2667.13.camel@sbs-t61.sc.intel.com> (raw)
In-Reply-To: <4AAEF5DC.4070308@cn.fujitsu.com>

On Mon, 2009-09-14 at 19:03 -0700, Xiao Guangrong wrote:
> > Your current fix is not clean and not complete in my opinion (as calling
> > interrupt handlers manually and not doing the callbacks etc might cause
> > other side affects). Thanks.
> 
> It is not the last version and doing the callbacks in another patch,
> see below URL please:
> http://marc.info/?l=linux-mm-commits&m=124900028228350&w=2

I am referring to this latest patch only. We are calling the interrupt
handler manually and not doing the callbacks in that context. In future,
we might see other side affects if we miss some of these smp ipi's.

Clean solution is to ensure that there are no unhandled smp call
function handlers and then continue with the cpu offline.

> Another problem is that all CPU must call quiesce_smp_call_functions() here, but only
> dying CPU need do it.

In stop_machine() all cpu's will wait for each other to come to the
rendezvous point. so this is completely ok (infact this is what is
happening if some cpu is already handling some ipi's etc. I am just
making it more explicit).

> 
> >  				local_irq_disable();
> >  				hard_irq_disable();
> 
> It will cause another race, if CPU A send a IPI interruption after CPU B call
> quiesce_smp_call_functions() and disable IRQ, it will case the same problem.
> (in this time, CPU B is enter stop machine, but CPU A is not)

No. By the time we call quiesce_ipis(), all the cpu's are already in
stop machine FIFO threads and no one else can send IPI (i.e, all the
cpus have moved past the STOPMACHINE_PREPARE state). This is when we are
calling the quiesce_smp_call_functions().

thanks,
suresh


  reply	other threads:[~2009-09-16  2:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200907310030.n6V0Uqgw001644@imap1.linux-foundation.org>
     [not found] ` <1252616988.7205.102.camel@laptop>
2009-09-11  7:45   ` Xiao Guangrong
2009-09-11  7:50     ` Peter Zijlstra
2009-09-11 19:08     ` Suresh Siddha
2009-09-14  7:22       ` Xiao Guangrong
2009-09-15  0:16         ` Suresh Siddha
2009-09-15  2:03           ` Xiao Guangrong
2009-09-16  2:20             ` Suresh Siddha [this message]
2009-09-17  3:00               ` Xiao Guangrong
2009-09-17  7:45                 ` Peter Zijlstra
2009-09-19  2:16                 ` Suresh Siddha
2009-09-21  2:55                   ` Xiao Guangrong
2009-09-21  3:11                     ` Suresh Siddha
2009-09-21  4:04                       ` Xiao Guangrong
2009-09-22  5:32                         ` Suresh Siddha
2009-09-22  6:52                           ` Xiao Guangrong

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=1253067602.2667.13.camel@sbs-t61.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mm-commits@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    --cc=xiaoguangrong@cn.fujitsu.com \
    /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

all inboxes | Powered by JetHome®