All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	"paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"jeremy.fitzhardinge@citrix.com" <jeremy.fitzhardinge@citrix.com>,
	"nickpiggin@yahoo.com.au" <nickpiggin@yahoo.com.au>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Mallick, Asit K" <asit.k.mallick@intel.com>
Subject: Re: [patch] generic-ipi: fix the smp_mb() placement
Date: Thu, 30 Oct 2008 09:30:08 -0700	[thread overview]
Message-ID: <20081030163008.GL30573@linux-os.sc.intel.com> (raw)
In-Reply-To: <20081030072029.GK31673@kernel.dk>

On Thu, Oct 30, 2008 at 12:20:30AM -0700, Jens Axboe wrote:
> > @@ -76,6 +72,11 @@ static void generic_exec_single(int cpu, struct call_single_data *data)
> >  	list_add_tail(&data->list, &dst->list);
> >  	spin_unlock_irqrestore(&dst->lock, flags);
> >  
> > +	/*
> > +	 * Make the list addition visible before sending the ipi.
> > +	 */
> > +	smp_mb();
> > +
> >  	if (ipi)
> >  		arch_send_call_function_single_ipi(cpu);
> 
> We can downgrade this to a smp_wmb().

No. We want the ipi receiver to see the new consistent data rather than possible
old consistent data.

And on x86, smp_wmb() is a simple barrier() (in !CONFIG_X86_OOSTORE) and
which doesn't do much in this case.

on x86 mfence (smp_mb()) will ensure that msr based APIC (x2apic) accesses (ipi)
will be visible only after the memory operations before smp_mb() are made
visible.

thanks,
suresh

  reply	other threads:[~2008-10-30 16:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29 22:42 [patch] generic-ipi: fix the smp_mb() placement Suresh Siddha
2008-10-30  7:20 ` Jens Axboe
2008-10-30 16:30   ` Suresh Siddha [this message]
2008-10-30 17:25     ` Jens Axboe
2008-10-30 18:53 ` Ingo Molnar
2008-10-30 20:23   ` Suresh Siddha
2008-10-31  5:10     ` Jeremy Fitzhardinge
2008-10-31  9:39       ` Ingo Molnar
2008-10-31 11:12         ` Jeremy Fitzhardinge
2008-10-31 16:53           ` Suresh Siddha
2008-10-31 20:30             ` Jeremy Fitzhardinge
2008-11-03 10:17               ` Ingo Molnar
2008-11-03 23:48                 ` Jeremy Fitzhardinge
2008-11-04  9:19                   ` Ingo Molnar
2008-11-04 22:25                     ` Suresh Siddha
2008-11-05  9:20                       ` Jens Axboe

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=20081030163008.GL30573@linux-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=asit.k.mallick@intel.com \
    --cc=jens.axboe@oracle.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.