From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 17:50:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44AE4106567A; Mon, 4 Jun 2012 17:50:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 13E308FC1E; Mon, 4 Jun 2012 17:50:12 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 71154B99F; Mon, 4 Jun 2012 13:50:11 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Date: Mon, 4 Jun 2012 12:09:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201206021810.q52IAGZA004238@svn.freebsd.org> <20120604142749.GB85127@deviant.kiev.zoral.com.ua> In-Reply-To: <20120604142749.GB85127@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201206041209.42075.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Jun 2012 13:50:11 -0400 (EDT) Cc: Attilio Rao , svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include 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: Mon, 04 Jun 2012 17:50:12 -0000 On Monday, June 04, 2012 10:27:49 am Konstantin Belousov wrote: > On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote: > > 2012/6/4 Konstantin Belousov : > > > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote: > > >> On 02-06-2012 20:10, Konstantin Belousov wrote: > > >> > Author: kib > > >> > Date: Sat Jun 2 18:10:16 2012 > > >> > New Revision: 236456 > > >> > URL: http://svn.freebsd.org/changeset/base/236456 > > >> > > > >> > Log: > > >> > Use plain store for atomic_store_rel on x86, instead of implicitly > > >> > locked xchg instruction. IA32 memory model guarantees that store has > > >> > release semantic, since stores cannot pass loads or stores. > > >> > > >> They can pass non-temporal stores can't they? > > > Sure. But (our) barriers only work for WB memory accesses, in respect to other > > > WB memory accesses. > > > > > > The atomic(9) contains not quite explicit mention of the requirement, > > > for ia32 and more direct notion for ia64. It could probably be reworded to > > > mention memory access type explicitely for ia32 too. > > > > I don't think this is right. > > What if I want to use NTI in a block of code locked? What if I want to > > use CLFLUSH? I simply cannot do that now because of the reordering > > requirement. > Assuming that NTI means "Non Temporal Instruction", Intel explicit > requirement is to use fence barrier if order shall be ensured. This, > as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH > is documented by Intel to _not_ serialize with any other fencing or > serialization instruction, except MFENCE. So xchg-based _store_rel is > not different from mov-based _store_rel for CLFLUSH and non-temporal > ops. I agree, having recently worked with movnt at work, if you are going to use these instructions, you will need to use your own explicit fences. No code should depend on implict barriers in locking primitives for working with movnt. -- John Baldwin