Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Apr 2015 07:06:03 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        Attilio Rao <attilio@FreeBSD.org>, adrian@freebsd.org, Alan Cox <alc@rice.edu>, Konstantin Belousov <kib@FreeBSD.org>, freebsd-arch@freebsd.org
Subject:   Re: atomic ops
Message-ID:  <A3DFECF4-ABA7-450C-AC13-2A2672BCF6A8@bsdimp.com>
In-Reply-To: <20150409061448.GB6086@dft-labs.eu>
References:  <20141028025222.GA19223@dft-labs.eu> <20150409061448.GB6086@dft-labs.eu>

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

--Apple-Mail=_F8FEC27C-BD9E-4735-8904-E51A12661A9D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Apr 9, 2015, at 12:14 AM, Mateusz Guzik <mjguzik@gmail.com> wrote:
>=20
> On Tue, Oct 28, 2014 at 03:52:22AM +0100, Mateusz Guzik wrote:
> [scratching old content so that I hopefully re-state it nicer]
>=20
> I would like to reviwe the discussion about memory barriers provided =
in
> the kernel.
>=20
> The kernel (at least on amd64) lacks lightweight barriers providing =
only
> following guarantees:
> - all writes are completed prior to given point
> - all reads are completed prior to given point

What does completed mean? That=E2=80=99s a very crappy definition since =
it
means a range of things.
(1) The CPU has pushed the writes to cache, but the cache is coherent =
across the whole CPU complex.
(2) The cache has flushed it to the memory controller / PCIe bridge
(3) The memory has actually been updated / The PCIe bridge has pushed =
the write to the card.
(4) The card has completed its transaction.

Which one is it? What=E2=80=99s its purpose? The efficient =
implementation requires
the definition be towards the start of the list. Convenient programming =
of certain
devices, however, requires the end=E2=80=A6

Warner


--Apple-Mail=_F8FEC27C-BD9E-4735-8904-E51A12661A9D
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJVJnk7AAoJEGwc0Sh9sBEA7NkP/jUBhUi64iqzieCh1IgCrg/l
Dpecq/QEYmC2XtOVm9YVyoqLQptrxb2zg7LjKoAcjMA8Io9EpxZucsZYohaZnos4
3jAEklukZpxZZ71ulhWBYrmvccn6atIPyzeoSWPWS+okTvDXBRYZ4OYAlPKvTMso
PLM9aSAvQ6TxSzsR0LOjYAWax9aM3MHxoqWjgS5poemAkSu+qA+gMTaW0bM/7TEF
FgGrEuIrjEwSF2hs2THfytQj/2otv8wPLVALlzgd9W9+DbnqCC+mKMSiXr9yEHCv
qeuz5kmEx6QRJs7wb3OYn/st4JTUoIoLu7kNHYGlqYqNCBKzl3GxL2HH58uPasv1
j/FHRNwg2+HVDF/7I5X2NzXwoa9MXeL5WCgZQj6We9DL+qPXutvofzF6MoCLTjmy
9Hr884IXG6APvozopvEp0Xm1FI+UEVeiXSM22SDeqaPH/d/4/A5V3nxdpPzDEjQP
uDyrrRW7AWK/h3Ad1UBFVebclnaUILqIR9nzLV8CNXl4J5R4CFM7ae0QEq0H4O7c
z8TfyHyQnTaM7XY0FtZ9TOWY1UlzgmPordZtA5EwUvyYz/zrfR300D4lgOLatY51
rYJkwlSEEWJlbxDQnLuw+qFYyt0Kx+2TpifQ9EouiCPnE8hpb6tsVq9YjA7V1jlQ
L8wGp9mQINM/E7BBu+cd
=IJLJ
-----END PGP SIGNATURE-----

--Apple-Mail=_F8FEC27C-BD9E-4735-8904-E51A12661A9D--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A3DFECF4-ABA7-450C-AC13-2A2672BCF6A8>