Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jun 1999 12:09:53 -0700
From:      Erich Boleyn <erich@uruk.org>
To:        Richard Cownie <tich@ma.ikos.com>
Cc:        freebsd-smp@FreeBSD.ORG
Subject:   Re: high-efficiency SMP locks - submission for review 
Message-ID:  <E10z3GU-0002Fv-00@uruk.org>
In-Reply-To: Your message of "Tue, 29 Jun 1999 13:44:36 EDT." <99062914233100.20670@par28.ma.ikos.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

Richard Cownie <tich@ma.ikos.com> wrote:

> On Tue, 29 Jun 1999, Kevin Van maren wrote:
> > On the x86, you do need to lock the bus to guarantee operations
> > are atomic, with the exception of xchg (but not the variants),
> > which is guaranteed to be atomic.  They also must be naturally-aligned.
> 
> No, you can have a non-aligned locked access - there's a bunch of
> complex and ugly stuff ("split locks", the SPLCK# bus signal) in
> the P6 bus protocol to support this. But don't do it if you can
> possibly avoid it - it's inefficient, and since it exercises arcane
> features of the hardware, it could be buggy.  

Whops, you're right.  This is sufficiently slow that I avoid it like
the plague in code and tend to forget it's supported architecturally.

But, as mentioned in the other email, the other advantage of natural
alignment is that for just reads and writes you don't have to lock
at all to be MP-safe.

--
    Erich Stefan Boleyn                      \_         <erich@uruk.org>
  Mad but Happy Scientist                      \__    http://www.uruk.org/
  Motto: "I'll live forever or die trying"        ---------------------------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E10z3GU-0002Fv-00>