From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fGGEFmyifWA3dwAAWB0awg (envelope-from ) for ; Mon, 19 Apr 2021 11:31:56 -0400 Received: by simark.ca (Postfix, from userid 112) id 4EB9A1F104; Mon, 19 Apr 2021 11:31:56 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1C4E81E813 for ; Mon, 19 Apr 2021 11:31:55 -0400 (EDT) Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4FP9lt4k10z1YNR; Mon, 19 Apr 2021 11:31:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1618846314; bh=+jQ2NZziseW4iFB2Jx2t4eI4nG17VfIJBDc+oHMKhE0=; h=Date:To:Cc:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DY/NJZKi/VDDQ9vy9ZgJ/KmDR4FGfQWfahFbIJP1CJW261sW51Yuw+RzLHQ4FR0Ut +gdX/bnJwGwu6rLjrNSpw1QonMnxfgidXREZPNB+hKgTWJ6nhiOWv7/SeYkHDM5tWs OOPJ4CiENSigrjBmLEZXdDMn4rPsJoIvAqLCzVRa/9SQEyKz8ZKYSPPrWLMjl85aSZ VA2Q4hf1FQd1+z/UUlwduGk4TXoVypFmI1cccLbcotkWfwXWLWERgiNM/Q9IoExTWn xGC9iXmoGlAxQYoMbx1IzCCFCj31+XoLK5t1UFXHARoUlWLHDR2Fom+Dz1OxAuZDiY jou4b03IjqE9Q== Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by lists.lttng.org (Postfix) with ESMTPS id 4FP9ls4xwXz1WLj for ; Mon, 19 Apr 2021 11:31:52 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 0BCFC2DC967 for ; Mon, 19 Apr 2021 11:31:46 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vFL1SnCaoW0d; Mon, 19 Apr 2021 11:31:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 904002DC8D3; Mon, 19 Apr 2021 11:31:45 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 904002DC8D3 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lk1KznslQvk6; Mon, 19 Apr 2021 11:31:45 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 7E3E52DC9DD; Mon, 19 Apr 2021 11:31:45 -0400 (EDT) Date: Mon, 19 Apr 2021 11:31:45 -0400 (EDT) To: Duncan Sands , paulmck Cc: lttng-dev Message-ID: <1645001619.285.1618846305316.JavaMail.zimbra@efficios.com> In-Reply-To: <7972b031-59b9-7fb5-6379-58bcec13a769@free.fr> References: <1680415903.81652.1618584736742.JavaMail.zimbra@efficios.com> <0b613c40-24b4-6836-d47b-705ac0e46386@free.fr> <612661965.84539.1618605578871.JavaMail.zimbra@efficios.com> <7972b031-59b9-7fb5-6379-58bcec13a769@free.fr> MIME-Version: 1.0 X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4018 (ZimbraWebClient - FF87 (Linux)/8.8.15_GA_4007) Thread-Topic: liburcu: LTO breaking rcu_dereference on arm64 and possibly other architectures ? Thread-Index: 5wRiM4738o8hJu7t5gIasyRX88mAYw== Subject: Re: [lttng-dev] liburcu: LTO breaking rcu_dereference on arm64 and possibly other architectures ? X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mathieu Desnoyers via lttng-dev Reply-To: Mathieu Desnoyers Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" ----- On Apr 19, 2021, at 5:41 AM, Duncan Sands baldrick@free.fr wrote: > >> Quick question: should we use __atomic_load() or atomic_load_explicit() (C) and >> (std::atomic<__typeof__(x)>)(x)).load() (C++) ? > > If both are available, is there any advantage to using the C++ version when > compiling C++? As opposed to using the C11 one for both C and C++? I recently noticed that using C11/C++11 atomic load explicit is not a good fit for rcu_dereference, because we want the type to be a pointer, not an _Atomic type. gcc appears to accept a looser typing, but clang has issues trying to build that code. So I plan to use __atomic(p, v, __ATOMIC_CONSUME) instead in both C and C++. Also, I'll drop the cmm_smp_read_barrier_depends() when using __ATOMIC_CONSUME, because AFAIU their memory ordering semantics are redundant for rcu_dereference. Here is the resulting commit for review on gerrit: https://review.lttng.org/c/userspace-rcu/+/5455 Fix: use __atomic_load() rather than atomic load explicit [NEW] Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev