From owner-svn-src-all@FreeBSD.ORG Wed Jan 18 18:49:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE78C1065670; Wed, 18 Jan 2012 18:49:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A4C568FC18; Wed, 18 Jan 2012 18:49:09 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 5A46A46B09; Wed, 18 Jan 2012 13:49:09 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9B127B96B; Wed, 18 Jan 2012 13:49:08 -0500 (EST) From: John Baldwin To: davidxu@freebsd.org Date: Wed, 18 Jan 2012 10:09:23 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <201201170957.47718.jhb@freebsd.org> <4F1629D5.4020605@gmail.com> In-Reply-To: <4F1629D5.4020605@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201181009.23221.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Jan 2012 13:49:08 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 18:49:09 -0000 On Tuesday, January 17, 2012 9:09:25 pm David Xu wrote: > On 2012/1/17 22:57, John Baldwin wrote: > > On Monday, January 16, 2012 1:15:14 am David Xu wrote: > >> Author: davidxu > >> Date: Mon Jan 16 06:15:14 2012 > >> New Revision: 230201 > >> URL: http://svn.freebsd.org/changeset/base/230201 > >> > >> Log: > >> Insert read memory barriers. > > I think using atomic_load_acq() on sem->nwaiters would be clearer as it would > > indicate which variable you need to ensure is read after other operations. In > > general I think raw rmb/wmb usage should be avoided when possible as it is > > does not describe the programmer's intent as well. > > > Yes, I had considered that I may use atomic_load_acq(), but at that time, > I thought it emits a bus locking, right ? so I just picked up rmb() which > only affects current cpu. maybe atomic_load_acq() does same thing with > rmb() ? > it is still unclear to me. atomic_load_acq() is the same as rmb(). Right now it uses a locked instruction on amd64, but it could easily switch to lfence/sfence instead. I had patches to do that but I think bde@ had done some benchmarks that showed that change made no difference. -- John Baldwin