From owner-freebsd-current@FreeBSD.ORG Thu May 6 07:15:53 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA34216A4CE for ; Thu, 6 May 2004 07:15:53 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C84043D1F for ; Thu, 6 May 2004 07:15:53 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i46EFrxZ018524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 May 2004 10:15:53 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i46EFi4M002317; Thu, 6 May 2004 10:15:44 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16538.18576.320694.79356@grasshopper.cs.duke.edu> Date: Thu, 6 May 2004 10:15:44 -0400 (EDT) To: Don Bowman In-Reply-To: References: X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: freebsd-current@FreeBSD.org cc: Gerrit Nagelhout Subject: RE: 4.7 vs 5.2.1 SMP/UP bridging performance X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2004 14:15:54 -0000 Don Bowman writes: > > On the P4, there are mfence,lfence,sfence instructions to enforce > memory ordering. These are cheaper than "lock; andl" or "cpuid", > which are the traditional 'sync' instructions. For what its worth, using those operations yeilds these results on my 2.53GHz P4 (for UP) Mutex (atomic_store_rel_int) cycles per iteration: 208 Mutex (sfence) cycles per iteration: 85 Mutex (lfence) cycles per iteration: 63 Mutex (mfence) cycles per iteration: 169 Mutex (none) cycles per iteration: 18 lfence looks like a winner.. Drew