From owner-freebsd-arch@FreeBSD.ORG Thu Apr 9 13:06:15 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A23915EE for ; Thu, 9 Apr 2015 13:06:15 +0000 (UTC) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CEB464A for ; Thu, 9 Apr 2015 13:06:15 +0000 (UTC) Received: by pddn5 with SMTP id n5so152493376pdd.2 for ; Thu, 09 Apr 2015 06:06:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=5Wj1E8gctdY3bl3NwTaRmRA3fHEBZRXgi1tbzaBZUV4=; b=gK7Pk2jMP/pgIYkFvTO2SgaVhJt0EUJv2p4/07QZQPcMPE0RWTVl/QzcAcM+GRwf5u aFP3GflSgUML42iUcIZBH5ZqN4dGO87ZQU3gzclUfGgXytHcFYixk1YUgTplQ+OswS6e GZEJDmra3evntrH/NwEQOBYMuYoUk/P6F1XrQYAYjWg1FfGVt05oike7hApP/l33roBr 6LhWdvy+weYrtGwmQs/A5Ds8jvYpStJqyZ1LWr8MjeUZjjH/hpWLqmkdjHEJz0izczP5 Ikr9uERkdMhUnCVgDOGWmlPdE0CJcb4ZR4/c+AZ5S6wygjbkptM/4oChTMVRW+X1IsTQ xv9A== X-Gm-Message-State: ALoCoQkJU5ucZO21iZdnBLIB+zRiS8S39SxtoT/ItqAN57UlwKtrtO2U77W1CMenA4E+L1XO/K8K X-Received: by 10.68.231.40 with SMTP id td8mr55085880pbc.53.1428584769011; Thu, 09 Apr 2015 06:06:09 -0700 (PDT) Received: from [10.64.24.41] ([69.53.236.236]) by mx.google.com with ESMTPSA id cr1sm14576486pdb.7.2015.04.09.06.06.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Apr 2015 06:06:08 -0700 (PDT) Sender: Warner Losh Subject: Re: atomic ops Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F8FEC27C-BD9E-4735-8904-E51A12661A9D"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <20150409061448.GB6086@dft-labs.eu> Date: Thu, 9 Apr 2015 07:06:03 -0600 Message-Id: References: <20141028025222.GA19223@dft-labs.eu> <20150409061448.GB6086@dft-labs.eu> To: Mateusz Guzik X-Mailer: Apple Mail (2.2070.6) Cc: Attilio Rao , adrian@freebsd.org, Alan Cox , Konstantin Belousov , freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2015 13:06:15 -0000 --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 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--