Date: Thu, 05 Sep 2002 12:27:34 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Andrew Gallatin <gallatin@cs.duke.edu> Cc: freebsd-alpha@FreeBSD.ORG, ticso@cicely.de Subject: Re: alpha performance on -current Message-ID: <XFMail.20020905122734.jhb@FreeBSD.org> In-Reply-To: <15735.31557.85006.684144@grasshopper.cs.duke.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
:q
On 05-Sep-2002 Andrew Gallatin wrote:
>
> Bernd Walter writes:
> > On Thu, Sep 05, 2002 at 10:43:27AM -0400, John Baldwin wrote:
> > >
> > > On 05-Sep-2002 Andrew Gallatin wrote:
> > > > I'm using the appended diff, which I think is what you're suggesting:
> > >
> > > I think what he is really suggesting is to remove the mb's from all the
> > > atomic_foo ops that don't have _acq or _rel in them. The _acq and _rel
> > > versions should be wrappers that add mb's.
> >
> > Exactly.
>
> OK, I'm bound to make a hash of things. Can you show me what you
> mean?
Here's an example from just one of the atomic ops:
--- atomic.h 17 May 2002 05:45:39 -0000 1.14
+++ atomic.h 5 Sep 2002 16:24:28 -0000
@@ -51,16 +51,15 @@
u_int32_t temp;
__asm __volatile (
"1:\tldl_l %0, %2\n\t" /* load old value */
"bis %0, %3, %0\n\t" /* calculate new value */
"stl_c %0, %1\n\t" /* attempt to store */
"beq %0, 2f\n\t" /* spin if failed */
- "mb\n\t" /* drain to memory */
".section .text3,\"ax\"\n" /* improve branch prediction */
"2:\tbr 1b\n" /* try again */
".previous\n"
: "=&r" (temp), "=m" (*p)
: "m" (*p), "r" (v)
: "memory");
}
Thus, the only atomic ops that would have any barriers in them are
the _acq and _rel variants.
--
John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020905122734.jhb>
