Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: paulmck@linux.vnet.ibm.com (Paul E. McKenney)
Subject: [ltt-dev] [PATCH 1/3] Fix the "unknown" case
Date: Mon, 14 Jun 2010 10:05:55 -0700	[thread overview]
Message-ID: <20100614170555.GA2338@linux.vnet.ibm.com> (raw)
In-Reply-To: <4C165E12.2000803@redhat.com>

On Mon, Jun 14, 2010 at 06:51:30PM +0200, Paolo Bonzini wrote:
> On 06/14/2010 02:41 AM, Paul E. McKenney wrote:
> >The compiler (and sometimes the CPU) are within their rights to move
> >code into a lock-based critical section.  With two
> >locks:
> >
> >	do_first_thing();
> >	acquire_lock();
> >	release_lock();
> >	acquire_lock();
> >	release_lock();
> >	do_second_thing();
> >
> >the worst that the compiler and CPU can do is:
> >
> >	acquire_lock();
> >	do_first_thing();
> >	release_lock();
> >	acquire_lock();
> >	do_second_thing();
> >	release_lock();
> >
> >which is still acting like a memory barrier.
> 
> Interesting, so it's actually the release+acquire that is doing the
> job.  I thought about barrier+acquire+release+barrier, but that
> would placate the compiler only, not the CPU.

Strange but true!  ;-)

							Thanx, Paul




  reply	other threads:[~2010-06-14 17:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100611195937.GA18891@linux.vnet.ibm.com>
     [not found] ` <1276286430-21147-1-git-send-email-paulmck@linux.vnet.ibm.com>
2010-06-13 21:28   ` Mathieu Desnoyers
2010-06-14  0:41     ` Paul E. McKenney
2010-06-14 16:51       ` Paolo Bonzini
2010-06-14 17:05         ` Paul E. McKenney [this message]
2010-06-14 16:52       ` Paolo Bonzini
     [not found] ` <1276286430-21147-3-git-send-email-paulmck@linux.vnet.ibm.com>
2010-06-13 21:30   ` [ltt-dev] [PATCH 3/3] Remove unused sync_core() definitions Mathieu Desnoyers

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=20100614170555.GA2338@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.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