From owner-svn-src-head@FreeBSD.ORG Wed Jul 22 19:26:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2CE01065674; Wed, 22 Jul 2009 19:26:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 57BCD8FC12; Wed, 22 Jul 2009 19:26:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n6MJQiI7023524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jul 2009 22:26:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n6MJQibm085735; Wed, 22 Jul 2009 22:26:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n6MJQiUS085734; Wed, 22 Jul 2009 22:26:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 22 Jul 2009 22:26:44 +0300 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20090722192644.GX55190@deviant.kiev.zoral.com.ua> References: <200907221432.n6MEWcXB043644@svn.freebsd.org> <200907221445.25404.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JX3/dhvb8vz6C4q6" Content-Disposition: inline In-Reply-To: <200907221445.25404.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195820 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 19:26:50 -0000 --JX3/dhvb8vz6C4q6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 22, 2009 at 02:44:52PM -0400, Jung-uk Kim wrote: > On Wednesday 22 July 2009 10:32 am, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Jul 22 14:32:38 2009 > > New Revision: 195820 > > URL: http://svn.freebsd.org/changeset/base/195820 > > > > Log: > > When the page caching attributes are changed, after new mapping > > is established, OS shall flush the caches on all processors that > > may have used the mapping previously. This operation is not needed > > if processors support self-snooping. If not, but clflush > > instruction is implemented on the CPU, series of the clflush can be > > used on the mapping region. Otherwise, we have to flush the whole > > cache. The later operation is very expensive, and AMD-made CPUs do > > not have self-snooping. > > > > Implement cache flush for remapped region by using clflush for > > amd64, when supported by CPU. >=20 > --- >8 --- SKIP --- >8 --- >=20 > > @@ -267,6 +274,13 @@ outw(u_int port, u_short data) > > } > > > > static __inline void > > +mfence(void) > > +{ > > + > > + __asm__ __volatile("mfence" : : : "memory"); > > +} > > + > > +static __inline void > > ia32_pause(void) > > { > > __asm __volatile("pause"); >=20 > Is there any reason why you want mfence() instead of mb() from=20 > machine/atomic.h? Char-to-char equal implementation of pmap_invalidate_cache_range() is developed for i386. Note that mb() is a barrier, while Intel notes that clflush only ordered with mfence. On i386, mb() is locked nop. --JX3/dhvb8vz6C4q6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkpnZ/MACgkQC3+MBN1Mb4hYgQCeMEq2b2hRipR/ZiUch0rZyozj 4J0AoLuTY2BE8OgChbfKRu3BlDy2Ju7H =IylY -----END PGP SIGNATURE----- --JX3/dhvb8vz6C4q6--