From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 52FC4A0C3F; Sat, 3 Jul 2021 13:29:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C369340040; Sat, 3 Jul 2021 13:29:45 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 98D794003E for ; Sat, 3 Jul 2021 13:29:44 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C52D05C00AC; Sat, 3 Jul 2021 07:29:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 03 Jul 2021 07:29:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=fm1; bh=GyZsWwKiYDpHO oeOH4W+Yzjdm0wVqb1hPf3bVUXvz38=; b=A9I9pO0eCjqaxgcSu1oqOL2aWJgq/ 3iqnLgGHdr2BXwDxrD9byqf5ZRDqWS6geXSB/kHfEKrNJA0QcmHpEYXh3Q4sw34y E8haiyBfPvKqE3RpHrZsK5Y11RyNxzkgtfYM6p6VOySymkviBOmTaGWuZDcC8yR0 brZsPSAtgK/z7nLCKaZDd4u2pMm1xDvnRd6IN/BPBub5PBX0aw37aoXFAuWVt9MN ATx/eS15TfzVSSv59QAKm9NENbpaTmu6lEXWeuNNHxSm0ftDZBeJOhMl+pMGzaVV 1cR9qKAV7RAXFyqYV0UTzD6oJs44wq/FBA/eHmdVzKIpga8dZIh0BF2JA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=GyZsWw KiYDpHOoeOH4W+Yzjdm0wVqb1hPf3bVUXvz38=; b=Lo9tVaKnQME0RftoXLM312 bEIWm0V1eRDOH7TlIU1H6JZA5t8r1A3LagD9MyTKn3UVesP8ZAy1w5L6gy/lWG4h akN4+Oxke9WIcAoqTF+f3fYEa0KHKsCv6/r66jLZ1cc9OgYYNSvBX+pF9jRYSUS3 ehVhGfinLN4bk2Kx3cAWba+MU3KvHAFX3lNhADx1isMFpwOE+zbFPWViT3yBvlPp ZdbcpqU1MNhfbxpXp+VaXpct2K1GqrfCOWI5k2jv62HMfMZcJsR18rncd9sX8edI khBRdygkZ7qBF42bh45dkjF9TP48c9UWntPRIQXPGXCAUJ6iP/ZMXEd4EFrzwbwQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeejtddggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgrshcu ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrf grthhtvghrnhepffegheetveffuefffeevgeelteetieefueetteejteegvdefiedvteev jefgfeegnecuffhomhgrihhnpeguphgukhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhn vght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 3 Jul 2021 07:29:41 -0400 (EDT) From: Thomas Monjalon To: honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, Phil Yang Cc: bruce.richardson@intel.com, konstantin.ananyev@intel.com, dev@dpdk.org, david.marchand@redhat.com, David Christensen Date: Sat, 03 Jul 2021 13:29:38 +0200 Message-ID: <1879045.6WiRxTbeAL@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: [dpdk-dev] atomic operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In the deprecation notices of DPDK 21.05, we can still read this: " * rte_atomicNN_xxx: These APIs do not take memory order parameter. This does not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappers using C11 atomic built-ins. These wrappers must be used for patches that need to be merged in 20.08 onwards. This change will not introduce any performance degradation. * rte_smp_*mb: These APIs provide full barrier functionality. However, many use cases do not require full barriers. To support such use cases, DPDK will adopt C11 barrier semantics and provide wrappers using C11 atomic built-ins. These wrappers must be used for patches that need to be merged in 20.08 onwards. This change will not introduce any performance degradation. " Should we keep these notifications forever? It is very difficult to find which wrapper to use. This is the guide we have: https://doc.dpdk.org/guides/prog_guide/writing_efficient_code.html#locks-and-atomic-operations There are 2 blog posts: https://www.dpdk.org/blog/2021/03/26/dpdk-adopts-the-c11-memory-model/ https://www.dpdk.org/blog/2021/06/09/reader-writer-concurrency/ Basically it says we should use "__atomic builtins" but there is example for simple situations like counters, memory barriers, etc. Please who could work on improving the documentation?