From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2i9h-0004yC-9B for qemu-devel@nongnu.org; Tue, 17 May 2016 12:47:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2i9b-0006P9-6H for qemu-devel@nongnu.org; Tue, 17 May 2016 12:47:36 -0400 Received: from mail-lb0-x241.google.com ([2a00:1450:4010:c04::241]:36340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2i9a-0006P2-Uh for qemu-devel@nongnu.org; Tue, 17 May 2016 12:47:31 -0400 Received: by mail-lb0-x241.google.com with SMTP id r5so1336412lbj.3 for ; Tue, 17 May 2016 09:47:30 -0700 (PDT) References: <1463196873-17737-1-git-send-email-cota@braap.org> <1463196873-17737-6-git-send-email-cota@braap.org> <573B43B8.2000306@gmail.com> <8681f86f-87fd-51fb-eab3-4b360775ae38@redhat.com> From: Sergey Fedorov Message-ID: <573B4B20.8010601@gmail.com> Date: Tue, 17 May 2016 19:47:28 +0300 MIME-Version: 1.0 In-Reply-To: <8681f86f-87fd-51fb-eab3-4b360775ae38@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 05/18] atomics: add atomic_test_and_set_acquire List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Emilio G. Cota" , QEMU Developers , MTTCG Devel Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Peter Crosthwaite , Richard Henderson On 17/05/16 19:23, Paolo Bonzini wrote: > > On 17/05/2016 18:15, Sergey Fedorov wrote: >> On 14/05/16 06:34, Emilio G. Cota wrote: >>> This new helper expands to __atomic_test_and_set with acquire semantics >>> where available; otherwise it expands to __sync_test_and_set, which >>> has acquire semantics. >> Why don't also add atomic_clear_release() for completeness? > The previous patch adds atomic_set_release. Yes, but it would take the advantage of __sync_lock_release() being just a release barrier rather than a full barrier of smp_mb() in atomic_set_release(). But that's only the case for legacy __sync built-ins (before GCC 4.7.0), though. Kind regards, Sergey