From owner-freebsd-smp Tue Jun 29 12: 8:50 1999 Delivered-To: freebsd-smp@freebsd.org Received: from uruk.org (unknown [209.180.166.90]) by hub.freebsd.org (Postfix) with ESMTP id 1E40B15456 for ; Tue, 29 Jun 1999 12:08:43 -0700 (PDT) (envelope-from erich@uruk.org) Received: from localhost ([127.0.0.1] helo=uruk.org) by uruk.org with esmtp (Exim 2.05 #1) id 10z3GU-0002Fv-00; Tue, 29 Jun 1999 12:09:54 -0700 To: Richard Cownie Cc: freebsd-smp@FreeBSD.ORG Subject: Re: high-efficiency SMP locks - submission for review In-reply-to: Your message of "Tue, 29 Jun 1999 13:44:36 EDT." <99062914233100.20670@par28.ma.ikos.com> Date: Tue, 29 Jun 1999 12:09:53 -0700 From: Erich Boleyn Message-Id: Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Richard Cownie 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 \_ 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