From: Nathan Froyd <froydnj@codesourcery.com>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 09/10] target-alpha: Implement load-locked/store-conditional properly.
Date: Thu, 25 Mar 2010 09:06:12 -0700 [thread overview]
Message-ID: <20100325160611.GU16726@codesourcery.com> (raw)
In-Reply-To: <4BAB853E.1070303@twiddle.net>
On Thu, Mar 25, 2010 at 08:46:06AM -0700, Richard Henderson wrote:
> On 03/25/2010 06:39 AM, Nathan Froyd wrote:
> > On Wed, Mar 24, 2010 at 05:11:43PM -0700, Richard Henderson wrote:
> >> Use __sync_bool_compare_and_swap to yield correctly atomic results.
> >> As yet, this assumes running on an strict-memory-ordering host (i.e. x86),
> >> since we're still "implementing" the memory-barrier instructions as nops.
> >
> > Did the approach taken by other targets (arm/mips/ppc) not work on
> > Alpha?
>
> Mips doesn't even pretend to be atomic.
It pretends just as much as ppc and arm. See translate.c:OP_ST_ATOMIC.
> Powerpc and Arm -- if I've got this straight -- use some sort of stop-the-world
> mutex+condition and then perform the compare-and-exchange by hand. I can't
> see how that's better than using an actual compare-and-exchange provided by
> the host cpu. In fact, I'm mildly horrified by the prospect.
Oh, I didn't say it was pretty. But it does work fairly well in
practice--enough to pass most of glibc's NPTL testsuite, for instance.
(The remaining cases are tricky things, like cross-process locks.) I
think--though Paul would remember better than I--that the stop-the-world
approach might have been taken due to a desire to continue compiling
with gcc < 4.1. I don't know how much of a desdirata that still is.
(stop-the-world is also somewhat less complex than the previous
implementation, which involved page protection games.)
Certainly using actual compare-and-exchange would be much faster.
-Nathan
next prev parent reply other threads:[~2010-03-25 16:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 0:24 [Qemu-devel] [PATCH 00/10, v3] target-alpha improvements Richard Henderson
2010-03-12 18:31 ` [Qemu-devel] [PATCH 01/10] target-alpha: Add flags markups to helpers.h Richard Henderson
2010-03-12 19:22 ` [Qemu-devel] [PATCH 02/10] target-alpha: Implement cpys{, n, e} inline Richard Henderson
2010-03-15 14:49 ` [Qemu-devel] [PATCH 03/10] target-alpha: Implement rs/rc properly Richard Henderson
2010-03-15 15:38 ` [Qemu-devel] [PATCH 05/10] target-alpha: Implement cvtlq inline Richard Henderson
2010-03-16 20:04 ` [Qemu-devel] [PATCH 06/10] target-alpha: Use setcond for int comparisons Richard Henderson
2010-03-16 21:44 ` [Qemu-devel] [PATCH 07/10] target-alpha: Use non-inverted arguments to gen_{f}cmov Richard Henderson
2010-03-16 22:10 ` [Qemu-devel] [PATCH 08/10] target-alpha: Emit goto_tb opcodes Richard Henderson
2010-03-19 22:55 ` [Qemu-devel] [PATCH 04/10] target-alpha: Implement cvtql inline Richard Henderson
2010-03-25 0:11 ` [Qemu-devel] [PATCH 09/10] target-alpha: Implement load-locked/store-conditional properly Richard Henderson
2010-03-25 13:39 ` Nathan Froyd
2010-03-25 15:46 ` Richard Henderson
2010-03-25 16:06 ` Nathan Froyd [this message]
2010-03-25 16:29 ` Richard Henderson
2010-03-25 16:42 ` Nathan Froyd
2010-03-25 16:50 ` Richard Henderson
2010-03-25 17:40 ` Blue Swirl
2010-03-25 18:19 ` Richard Henderson
2010-03-26 1:55 ` Jamie Lokier
2010-03-26 2:01 ` Jamie Lokier
2010-03-25 0:13 ` [Qemu-devel] [PATCH 10/10] target-alpha: Enable NPTL Richard Henderson
2010-03-26 1:52 ` [Qemu-devel] [PATCH 00/10, v3] target-alpha improvements Jamie Lokier
2010-03-26 13:37 ` Richard Henderson
2010-04-01 13:44 ` Paul Brook
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=20100325160611.GU16726@codesourcery.com \
--to=froydnj@codesourcery.com \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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.