From owner-freebsd-arch@FreeBSD.ORG Tue Aug 21 21:53:45 2007 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36A3916A417 for ; Tue, 21 Aug 2007 21:53:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id E130213C474 for ; Tue, 21 Aug 2007 21:53:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8k) with ESMTP id 204537132-1834499 for multiple; Tue, 21 Aug 2007 17:53:43 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l7LLrexe001627; Tue, 21 Aug 2007 17:53:40 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Maciej Sobczak Date: Tue, 21 Aug 2007 17:43:18 -0400 User-Agent: KMail/1.9.6 References: <20070818120056.GA6498@garage.freebsd.pl> <200708211403.29293.jhb@freebsd.org> <46CB5520.4090505@msobczak.com> In-Reply-To: <46CB5520.4090505@msobczak.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708211743.19269.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Tue, 21 Aug 2007 17:53:40 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/4021/Tue Aug 21 11:42:43 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-arch@freebsd.org Subject: Re: Lockless uidinfo. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2007 21:53:45 -0000 On Tuesday 21 August 2007 05:12:00 pm Maciej Sobczak wrote: > John Baldwin wrote: > > > Memory barriers on another CPU don't mean anything about the CPU thread 2 is > > on. > > Of course they do. Otherwise they would be completely useless. No. If you invoke a membar on CPU 1, it does not affect "when" CPU 2 will see that write. It does not post the write out immediately or such. Some people get confused by that. All a membar does is to order writes on CPU 1. You can take advantage of that by using membar's on a lock cookie to guarantee CPU 2 will see writes done by CPU 1 when it acquires the lock, but just throwing a membar on an stand-alone atomic operation does not close any races or guarantee anything about when CPU 2 will see that write. -- John Baldwin