Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Aug 2010 15:05:38 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Rui Paulo <rpaulo@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r211738 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace
Message-ID:  <20100824120538.GL2396@deviant.kiev.zoral.com.ua>
In-Reply-To: <0329C085-13EF-47F1-B8BB-DB7679444FAE@freebsd.org>
References:  <201008241111.o7OBBwvn074031@svn.freebsd.org> <20100824114818.GJ2396@deviant.kiev.zoral.com.ua> <0329C085-13EF-47F1-B8BB-DB7679444FAE@freebsd.org>

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

--eUhXrt0ludXSDj9h
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 24, 2010 at 12:59:30PM +0100, Rui Paulo wrote:
>=20
> On 24 Aug 2010, at 12:48, Kostik Belousov wrote:
> >> +#if defined(sun)
> >> 	for (i =3D 0; i < NCPU; i++) {
> >> 		mutex_enter(&cpu_core[i].cpuc_pid_lock);
> >> 		mutex_exit(&cpu_core[i].cpuc_pid_lock);
> >> 	}
> >> +#else
> >> +	/* XXX */
> >> +	__asm __volatile("": : :"memory");
> > Indeed XXX. Semantic of acquiring/releasing a mutex, even on Solaris,
> > is much stricter then performing compiler-level memory barrier.
>=20
> I don't know what kind of mutexes we have in FreeBSD to mimc this behavio=
r.

I believe that the usual sleepable mutex acquisition provides full barrier
both in Solaris and FreeBSD case. But, I also suspect that there is more
then just membar on current CPU. They use per-cpu mutexes, that is a known
technique to provide biased locking. See
http://blogs.sun.com/dave/resource/Asymmetric-Dekker-Synchronization.txt
for relatively long discussion.

--eUhXrt0ludXSDj9h
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkxztZEACgkQC3+MBN1Mb4jahQCgvb3gyQEUP0mz9mnXz62u2cre
ayIAoKv97KKKxnHeHsbWfN0o6udYgvbZ
=j+cU
-----END PGP SIGNATURE-----

--eUhXrt0ludXSDj9h--



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