From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id W5QVNHSnlGTiFQsAWB0awg (envelope-from ) for ; Thu, 22 Jun 2023 15:56:36 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=i99BfCcz; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CEE501E0BB; Thu, 22 Jun 2023 15:56:36 -0400 (EDT) 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)) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C703E1E0AC for ; Thu, 22 Jun 2023 15:56:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1687463794; bh=qRrFbVE1JKElVaxJO2pNvpXJqfAv/QSNOQAXF7xsexM=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=i99BfCczpldjjxcz4jD8V6u24VfJkrSRp7s+mk7X92ZDBvfaqUVqHDQrb5sAZNt9U OZaprgttpbsT8MUG6mcyHUGRNIovrkBduCztTNox2Q3vE/C4iJuaxV+IxD4oPtoepA kubN99MMyLoVGPCp55krY7MAkS+1xq6hX8rPyeoxCCITQh/fav7mK3yq7Ex24vPjKZ VWxvjH06x2dzfi8VZax5WlhrvYfCsaRCrfy5JKlI7y5pCjlB0E+maymdvyo4kcnloA khgNEUZai1shvx9S5noODm7yve0sWPDlGgh9EukyMRsuvhXqUQdn8lP0eVqeVHRyK8 NCj3wf9HKTumQ== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4QnB2p33tJz205h; Thu, 22 Jun 2023 15:56:34 -0400 (EDT) Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lists.lttng.org (Postfix) with ESMTPS id 4QnB2m1yMRz205g for ; Thu, 22 Jun 2023 15:56:32 -0400 (EDT) Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QnB2l1dP9z19Mh; Thu, 22 Jun 2023 15:56:31 -0400 (EDT) Message-ID: <9e5fbcf0-bf3d-c0b3-c45b-2e440e8276e1@efficios.com> Date: Thu, 22 Jun 2023 15:56:54 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US To: Olivier Dion , paulmck@kernel.org Cc: lttng-dev@lists.lttng.org References: <20230515201718.9809-1-odion@efficios.com> <20230515201718.9809-3-odion@efficios.com> <105bad2a-9fed-4353-a434-a571ce9da7ac@paulmck-laptop> <87zg4rl1du.fsf@laura> In-Reply-To: <87zg4rl1du.fsf@laura> Subject: Re: [lttng-dev] [PATCH 02/11] urcu/uatomic: Use atomic builtins if configured X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" On 6/22/23 15:53, Olivier Dion wrote: > On Thu, 22 Jun 2023, "Paul E. McKenney" wrote: > >> I suggest C11 volatile atomic load/store. Load/store fusing is permitted >> for non-volatile atomic loads and stores, and such fusing can ruin your >> code's entire day. ;-) > > Good catch. Seems like not a problem on GCC (yet), but Clang is extremely > aggressive and seems to do store fusing on some corner cases [0]. I don't think this is an example of store fusing, but rather just that the compiler can eliminate stores to static variables which are otherwise unused, making the entire variable useless. Thanks, Mathieu > > However, I do not find any simple reproducer of load/store fusing. Do > you have example of such fusing, or is this a precaution? In the > meantime, back to reading the standard to be certain :-) > > [0] https://godbolt.org/z/odKG9a75a > -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev