Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 2009 22:26:44 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Jung-uk Kim <jkim@freebsd.org>
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
Message-ID:  <20090722192644.GX55190@deviant.kiev.zoral.com.ua>
In-Reply-To: <200907221445.25404.jkim@FreeBSD.org>
References:  <200907221432.n6MEWcXB043644@svn.freebsd.org> <200907221445.25404.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090722192644.GX55190>