From owner-freebsd-arm@FreeBSD.ORG Sat Feb 21 17:16:42 2015 Return-Path: Delivered-To: freebsd-arm@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 11DF7FD8 for ; Sat, 21 Feb 2015 17:16:42 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7264DCB for ; Sat, 21 Feb 2015 17:16:41 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LHGfG7021687 for ; Sat, 21 Feb 2015 17:16:41 GMT (envelope-from root@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t1LHGfQA021686; Sat, 21 Feb 2015 17:16:41 GMT (envelope-from root) Date: Sat, 21 Feb 2015 17:16:41 +0000 To: freebsd-arm@freebsd.org From: "ian (Ian Lepore)" Subject: [Differential] [Commented On] D1833: Add memory barriers to buf_ring Message-ID: <7e6ad0fc0cfe2e877f3a5d611b370eda@localhost.localdomain> X-Priority: 3 Thread-Topic: D1833: Add memory barriers to buf_ring X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: OGRiNDkxY2NmMjRiNTc0MjQ4YTYwNWVkNzIyIFTovXk= X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2015 17:16:42 -0000 ian added a comment. >>! In D1833#26, @meloun-miracle-cz wrote: > ... > On ARM, all stores to variable referenced by atomic_cmpset() must be done by atomic_store (or by other > atomic_* functions), normal store doesn’t clear exclusive monitor. > Thus, for ARM we **!!MUST!!** use atomic_store() for each store to variable referenced by atomic_cmpset() ! > > Ohh, and note – current atomic_store() implementation on ARM is broken too, but fix is easy (see atomic store_*_64(). I'm commenting on just this aspect of Michal's comment, not the overall change. I'm not sure I agree that a normal store fails to clear the exclusive monitor, but even more importantly in this context... the discussion of that and any possible fixes for it shouldn't hold up this change right now. I'm specifically not commenting on (or formally reviewing) the overall behavior of the ring buffer code. I'm not qualified to do that without a lot more studying of the code and just don't have time right now. REVISION DETAIL https://reviews.freebsd.org/D1833 To: zbb, kmacy, rpaulo, imp Cc: meloun-miracle-cz, onwahe-gmail-com, andrew, ian, adrian, freebsd-arm