Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 2009 14:44:52 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@FreeBSD.org
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Konstantin Belousov <kib@FreeBSD.org>
Subject:   Re: svn commit: r195820 - in head/sys/amd64: amd64 include
Message-ID:  <200907221445.25404.jkim@FreeBSD.org>
In-Reply-To: <200907221432.n6MEWcXB043644@svn.freebsd.org>
References:  <200907221432.n6MEWcXB043644@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

--- >8 --- SKIP --- >8 ---

> @@ -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");

Is there any reason why you want mfence() instead of mb() from 
machine/atomic.h?

Jung-uk Kim



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