From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id adBQKtaqlGS9GAsAWB0awg (envelope-from ) for ; Thu, 22 Jun 2023 16:11:02 -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=og/lllgN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9F1A01E0BB; Thu, 22 Jun 2023 16:11:02 -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 937D01E0AC for ; Thu, 22 Jun 2023 16:11:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1687464659; bh=mtX84/pgKFtIE/28HQ8DGYwKdkuSRFh9KOSrqfnrVL8=; h=To:Cc:In-Reply-To:References:Date:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=og/lllgNGWlAKu8p6BN4yqOeWrZhb+UhnU8W6ijV/YInInubWj5aVxOOw0rAfr24f wbNfXqkkqAp6kQEcnbjLwdRp+jAD560XUiVN7YTzPlXpvPZGjoluPhcz3KiLml5NMX oe6LGvGcO3zN0Z3PCsU3ItWKREAy1bL+UBt/OA4TyGnnNg7lxKB2vbU9wHkaIqC+2e ZjXs3Bu6e0HJo/TQETV7fMsb1CI/Wq+TUcuB5zDdVG6FiKJtKBcpqmI0+8G8fHyzsj 7mjDlGM9avsAi35/03pF7Z8LsJpeU69fjs0Vdu1HMNOyEDUIEgE90HU+ol7UsMs+Wy MRFNzgmbRXr7g== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4QnBMR43Xpz20Qb; Thu, 22 Jun 2023 16:10:59 -0400 (EDT) Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lists.lttng.org (Postfix) with ESMTPS id 4QnBMR15qHz20QZ for ; Thu, 22 Jun 2023 16:10:59 -0400 (EDT) Received: from localhost (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QnBMP2nXjz191Z; Thu, 22 Jun 2023 16:10:57 -0400 (EDT) To: Mathieu Desnoyers , paulmck@kernel.org Cc: lttng-dev@lists.lttng.org In-Reply-To: <9e5fbcf0-bf3d-c0b3-c45b-2e440e8276e1@efficios.com> Organization: EfficiOS References: <20230515201718.9809-1-odion@efficios.com> <20230515201718.9809-3-odion@efficios.com> <105bad2a-9fed-4353-a434-a571ce9da7ac@paulmck-laptop> <87zg4rl1du.fsf@laura> <9e5fbcf0-bf3d-c0b3-c45b-2e440e8276e1@efficios.com> Date: Thu, 22 Jun 2023 16:10:57 -0400 Message-ID: <87v8ffl0ku.fsf@laura> MIME-Version: 1.0 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: Olivier Dion via lttng-dev Reply-To: Olivier Dion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" On Thu, 22 Jun 2023, Mathieu Desnoyers wrote: > 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. Indeed, that is not store fusing. It is however interesting to see that the dead store elimination is avoid when casting one of the &x with a volatile qualifier. TIL dead store can apply to atomics. -- Olivier Dion 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