From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id FqbxA0uok2TIXwoAWB0awg (envelope-from ) for ; Wed, 21 Jun 2023 21:47:55 -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=lio2W+0R; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 05D4A1E0BB; Wed, 21 Jun 2023 21:47:55 -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 F02C31E00F for ; Wed, 21 Jun 2023 21:47:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1687398472; bh=JKCj3lSfIvvZVK8+JavgIsMtqfg4fI2GAggGmD51N8Q=; 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=lio2W+0RRQhTptzZWeKjNaa80ojGD7lu5qi2DsPO2/TAgTb3hUohUvwTE9ep+59Mf Z2NVumbL5iWCYugtUvJZWHMaRnm7gZdOgGkk8bxEVIMFXxhsu5BsQdE/+8R4ee95U4 7tqqzaFpwxgLyDW/cLvb9M2S8l7WGYSmv+YmbhRK+0M+2RIjjG6KFmSQWw9fk9JJP/ 4dCvbw6f67dlA5+P/MLItRyO70WJ0A9PZ7k+YTzDJ38u8tV9TPF9xhuYKpWJ/ebZK6 R6A+kIhAEMkKoWmoK7ag/j3udlZTQj78cd0JO51Q7lrlWRV7bIHDTzot5ntkeChZ9V GNe7fN6myx4Dw== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4Qmjtc19sGz2068; Wed, 21 Jun 2023 21:47:52 -0400 (EDT) Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lists.lttng.org (Postfix) with ESMTPS id 4QmjtY0yRxz2067 for ; Wed, 21 Jun 2023 21:47:48 -0400 (EDT) Received: from [192.168.18.28] (unknown [198.16.185.171]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QmjtX1prlz18rm; Wed, 21 Jun 2023 21:47:48 -0400 (EDT) Message-ID: <9ca1c2ca-a027-7178-f552-e0f8fa8f2d2f@efficios.com> Date: Wed, 21 Jun 2023 21:48:10 -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-5-odion@efficios.com> <877crwmi54.fsf@laura> In-Reply-To: <877crwmi54.fsf@laura> Subject: Re: [lttng-dev] [PATCH 04/11] urcu/arch/generic: 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/21/23 20:53, Olivier Dion wrote: > On Wed, 21 Jun 2023, "Paul E. McKenney" wrote: >> On Mon, May 15, 2023 at 04:17:11PM -0400, Olivier Dion wrote: >>> #ifndef cmm_mb >>> #define cmm_mb() __sync_synchronize() >> >> Just out of curiosity, why not also implement cmm_mb() in terms of >> __atomic_thread_fence(__ATOMIC_SEQ_CST)? (Or is that a later patch?) > > IIRC, Mathieu and I agree that the definition of a thread fence -- acts > as a synchronization fence between threads -- is too weak for what we > want here. For example, with I/O devices. > > Although __sync_synchronize() is probably an alias for a SEQ_CST thread > fence, its definition -- issues a full memory barrier -- is stronger. > > We do not want to rely on this assumption (alias) and prefer to rely on > the documented definition instead. > We should document this rationale with a new comment near the #define, in case anyone mistakenly decides to use a thread fence there to make it similar to the rest of the code in the future. Thanks, Mathieu -- 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