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 1E001A0A0C; Mon, 5 Jul 2021 10:33:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEB3A40141; Mon, 5 Jul 2021 10:33:37 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130058.outbound.protection.outlook.com [40.107.13.58]) by mails.dpdk.org (Postfix) with ESMTP id 4526D4003C for ; Mon, 5 Jul 2021 10:33:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UOB2mZBMFRQKU2fMvgkKsQAWVILS7vF3BhS6Br9Z3H8=; b=qTtZoyfSxLnxfIm9l1PEHcb2inLjKkr1gia4Bjdx5Pm7AnnNIYCaYLF8l7nBWcolW+HKBax7wWc3xmAeaZL0VMUiqG6YI/UX1L6gTmN6aCF58N2ygenwGZYoQEia13JcxOJ5lz+eSAqu4bIqFbxwlTnm1NyU74qq8f2c9TQnUe0= Received: from DB9PR06CA0020.eurprd06.prod.outlook.com (2603:10a6:10:1db::25) by DBBPR08MB4377.eurprd08.prod.outlook.com (2603:10a6:10:c6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.31; Mon, 5 Jul 2021 08:33:34 +0000 Received: from DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1db:cafe::b4) by DB9PR06CA0020.outlook.office365.com (2603:10a6:10:1db::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.21 via Frontend Transport; Mon, 5 Jul 2021 08:33:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT058.mail.protection.outlook.com (10.152.20.255) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Mon, 5 Jul 2021 08:33:34 +0000 Received: ("Tessian outbound 3362253f4878:v97"); Mon, 05 Jul 2021 08:33:34 +0000 X-CR-MTA-TID: 64aa7808 Received: from f3562e3a0a71.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 955DCFB0-83AE-4E1F-AFDA-270FC47452E3.1; Mon, 05 Jul 2021 08:33:24 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f3562e3a0a71.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 05 Jul 2021 08:33:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i3ZIaX8RH4k3SqjmnS1f/CvPNwPmRGEaAuDknIHbBeph9dCgIWrOREwWwQNC5mavRJGjhU7QWYH5o7nGItI2M48uEIRS8wGvHqlLhZl9XBpjW0Kh9dAq24Y51p0dyxoWj9xtLUXXvBQ0ck+38EToCV+7cz6yh0HM2YY7LBuI6ImdBrofh3Wt0ApqIJm5SYikfMOw3FfkQbMU7Fra8lQlzsG92q4KzNBF6HTHu2cUVVf/ArTsDZsxkE23oopa6CNRWIMm33xxUDZGXJiU/PhHrkHynssi4+UV5gLGGWt9rUcgzDtgqonfe+LlXyM1L8/6zF4lmPGSxFTbm7lT4bVZgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UOB2mZBMFRQKU2fMvgkKsQAWVILS7vF3BhS6Br9Z3H8=; b=JiBgP92LyMSgUakk/MEL2MBhCUuXmRIJOHmnANi9Go7IUCg4t3JS7iwNR4Vg0RiY3G+Y1jY4rFixTx4P1NDyi5oRGbXIWqp5c/Jns7a5Jc3tbNhSX4X22+/MKTvqrniy0gnk2HypN05/K2XTGlfUlW8lqPHiNc13R3hza6PiTAaQowFhIEdND8XOgpyeLZTkByyiuwy806fychQxkw7OH8uV96JPPtG2xdYQ4Qt8xszRhLBxCIYPP80DGz3zSu/7VCMMZVlcfo3xUh0W82T9WLgFrPSbs1q64PWR7oABxctNzgftoqirkWxMuzkZdkwqZuTi4t0XU62HTecJroPkww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UOB2mZBMFRQKU2fMvgkKsQAWVILS7vF3BhS6Br9Z3H8=; b=qTtZoyfSxLnxfIm9l1PEHcb2inLjKkr1gia4Bjdx5Pm7AnnNIYCaYLF8l7nBWcolW+HKBax7wWc3xmAeaZL0VMUiqG6YI/UX1L6gTmN6aCF58N2ygenwGZYoQEia13JcxOJ5lz+eSAqu4bIqFbxwlTnm1NyU74qq8f2c9TQnUe0= Received: from AM5PR0802MB2465.eurprd08.prod.outlook.com (2603:10a6:203:9f::22) by AM6PR08MB4614.eurprd08.prod.outlook.com (2603:10a6:20b:85::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21; Mon, 5 Jul 2021 08:33:21 +0000 Received: from AM5PR0802MB2465.eurprd08.prod.outlook.com ([fe80::3d12:4220:b215:7c52]) by AM5PR0802MB2465.eurprd08.prod.outlook.com ([fe80::3d12:4220:b215:7c52%8]) with mapi id 15.20.4287.033; Mon, 5 Jul 2021 08:33:21 +0000 From: Ruifeng Wang To: "thomas@monjalon.net" , Honnappa Nagarahalli CC: "dev@dpdk.org" , "bruce.richardson@intel.com" , "konstantin.ananyev@intel.com" , "dev@dpdk.org" , "david.marchand@redhat.com" , David Christensen , nd , nd Thread-Topic: [dpdk-dev] atomic operations Thread-Index: AQHXb/7FkuVc8wZjiESHA5el5SVN4qsx+Z0AgAHxdFCAABQTAIAADaaw Date: Mon, 5 Jul 2021 08:33:21 +0000 Message-ID: References: <1879045.6WiRxTbeAL@thomas> <1806192.QIeOlYoxj9@thomas> <2658239.2zj59f8sm8@thomas> In-Reply-To: <2658239.2zj59f8sm8@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 4AACAD6963398B438E27A8D6130C5253.0 x-checkrecipientchecked: true Authentication-Results-Original: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; x-originating-ip: [203.126.0.112] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: e6a6c360-d717-4eed-b9a7-08d93f8f93c5 x-ms-traffictypediagnostic: AM6PR08MB4614:|DBBPR08MB4377: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 1nBz8+ye3pO5s84AJyekJeozAm/rmAsCKdY/ihuay4memQzG994uWiZ3PBzzMpvY+/u9p9Sh4PP+lcHVdYmw+XEnwxd99OeS80y6r1ccpvCR02J5D++MRAHEbneESJYwPuaAxzIkTuxgLy4k17Z6083iYezJZqnnh9QISpquRRwZah9u3WVfgyKC1++Pd3JAo5mm/oCmqmlvLtY+6TqKWYBRhwTNU4iume1gp/u8xNT/PkfNHQoksLqrf0AjH3tnG+GbMN4ccnx8SNAnmh4JWpZmzyv/gfCvYsb/MzlY42LEVKxyepSkaENUutZrwFuexXdVaYfqk1LA3DjooncFdrN8iJdFJeIuKV3EGHc+gpxqS9G4wh7cWJvIC9J2nPedGRsmQGyIq09jD2RcXNhcJ8KL0kZz09MpHedR13rUUnEsWhU/2RdzDa/iafv8Yc4YEqoHxeb7oy4iDS+9pBKAfVE/kX1b2kL7N+wTUSo4uDIkljUvtOTOdzMz5UD6rN138qxrN+h9wyoBGmZrqQVNoP1VLFYg6eDiq/YNHc8ZnoTquQAN8D2zKZ5k2E80wGkcyXRjH9NqV4wTvYn0I1NqbInFVpP+BPDzDTzecdVAjUW06P0dqJtM28xwa0WR5n3hWKt2Zb6Pfp2wPKlhtm5+WnyjXEaE6hYSbGIINfjRVJxzgba9097dagOcrIeObzGvhxpuJ56fm4LKcsVu6vIYQCcN4JrqFIUpHEV+HyVxO+0LKeBgLwpoWKzPtOQz0y0SzK34m1zof0CsvUhry9JD+KBRhaUfjXQR1iYRRzjusO0ZmwXafEfZku26TStsL8L0or7cN2vejO3Dp/s4ViSeIg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM5PR0802MB2465.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(376002)(136003)(396003)(39850400004)(38100700002)(186003)(4326008)(6636002)(316002)(8676002)(966005)(7696005)(66476007)(122000001)(2906002)(26005)(86362001)(71200400001)(55016002)(5660300002)(64756008)(6506007)(76116006)(8936002)(9686003)(478600001)(83380400001)(66446008)(54906003)(110136005)(66946007)(52536014)(66556008)(53546011)(33656002)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UACvlzT9lmBt0Pujvx+TzI4DnF1ZFnrUnVh1ZAgL+/xLri8he18ARe2mlOHB?= =?us-ascii?Q?QRjBF9XG0+fBTsLdbrVXNJP0uNryG8W6nisx0bGMDBIguoYUoRtL9/mRjAuA?= =?us-ascii?Q?EjZjMBbJ0RWSpefjwug6sjthbBtBkZlw/6yTKjkjiVgI+TNCBJ64r9jd7Iiw?= =?us-ascii?Q?ZGQYO3+sjJmrs71M+0qXEcLesv3/zmtQt9lv/JndF0sK7P3Iv6H2BuoiCHX4?= =?us-ascii?Q?fGwDGJXwbRXLW28hE3zpPunztJJQIFdiQlLPYNhj6ZdHOm5kgLWQKgErE9gE?= =?us-ascii?Q?WFJ6Uak9yerNlp8E6y+22IRCWlW85m/uBGewzjXMp4QL+0eJWS2JRjtwQXG+?= =?us-ascii?Q?BQVShYLhgUaRWqHQAMCDEHYabByLybEEJcun5t/OG5muPP47pj3sUUd3L4H8?= =?us-ascii?Q?AnlFqbhtV9ytccDyDqmoU5xR7py25FwCQ5aF5rRx8rkK8ec86r2Tae9wHMvZ?= =?us-ascii?Q?2kF8+tKD6c35pOUzqP0gdwpYZxTXNfKZd8gXgkECbrdM63VTAmwFroU98KRY?= =?us-ascii?Q?Vm0dygAPcuk1YlNXPyQ8cWNGlXRfm8Io/244m1oHqvttRPODK63EljzXAiGI?= =?us-ascii?Q?48tuvtOwzPIq66QIjwJsLbuLY1gBLsb/eBor1Ip2iVHuwcQI1ldcO0bC4peh?= =?us-ascii?Q?JKUVwzIPUrondzNFB4uwL4bDAK0KwhHEIOrJronTuGuFD6CQKHIjTyupkP+4?= =?us-ascii?Q?29gzjEqv0f54B9x9xrXzHfNyD2Qha4rdZSgo/G4lwU4rg+7ETZcBdKqfEcnP?= =?us-ascii?Q?SQD90FdRMH/VX9lAzvFPCHcku9T3HBuOoxCsnhsRRtw6JZmQx6sxLECtEALA?= =?us-ascii?Q?OYw++TO3pQMuey1GMr6UjUptWiqkBZ3u11DucBQQ5XjrMB0qClSYpHkCIF3+?= =?us-ascii?Q?PPCNJ/7JYWulOODmm1PgvzmynjOCtVPMcm6UJIlPerTPuhYHy0T9V3o5DXf8?= =?us-ascii?Q?lepEZqbghESapz7BzW+q9Pbao2XVSt5ZLMPZbHqhbkdPeN/2WmP9quq9i6MQ?= =?us-ascii?Q?S35oV4AvCt5AQRiG4N0fmNRucryCHrDSEiNGaFCY/B+TqWToQYmzx/Dw1+/I?= =?us-ascii?Q?AX1LdUtpSZDPLe09YdXsEu+3KwzIpQmCW13dbVaYAdVhy6S7jYoBp7hD5Tjx?= =?us-ascii?Q?ThIjaHikvn8wSTuHUZ15U7dFKfmlyK3dBpBYrVRLrQyzhQd2JYe/zVXaRHAf?= =?us-ascii?Q?S0OixQGaTx1Ekgx4IQi/G7ZPcroYOuZnAiCGe+IPjMcxv1EHuKrtU+poYv8M?= =?us-ascii?Q?+O8/+fIFLUZxAbhBkV54OqxkXxjRByo1W9HIn2ZWB7+sXo3sst2oIYGvRrQ1?= =?us-ascii?Q?ilQHpONBV/pYOSPAUA7pUgwE?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4614 Original-Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 64be73b3-4d4d-4f55-072c-08d93f8f8c57 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RHUYVakBejWDI3USgBXMZyk4/uE0w85T0FeIWjNDwOkU6kXpFcRu75eEaalExzpjrDIMG3spGHP/PZtNb7r9dnXwwoIzqjRMPpyg8DW6C6y6tcmyOLyzjw9wgFU0/meb9XKxYXu98Zzk6Zo9+8SW9HA7aLs46MhgZlBUyyYispYFOT8XAIbL/yk0Ccqx0hWvYJ+9NWdOMWKbNWyc/9XOE5prZzrU8YTIKotOirUbjIt299zZL0DPHBwGEBhki4JBp2/vjfilkQfamEo5kLyNTVDDmoyhlfeOkX7sAKSG7pFdN8nn42NDSI1GU3bd8MWuwF5e4lv9v3jP8bSIk9Jq+Zlrrxe6xfZICmKviqv+70jXp2XkZjUqfN/zYzVM9IZFqoc3j/xEP8RBCvxQ1wYPrHJCR/79+jX4DIm/Kn4DxFxu2Z7iE2PdS7yF8k026VOmkBNG3Zw9t1T6bgZh9aZTdBAkhGQpvXxP/hVULLXZ06waZ+ENdyijizl7viXrxSsxDEBuyqEdMa/7S2d7p/1oNyTjmLL8KWObJNXeCOZkCgNmBXuyTalQ5jI03kKB7avTI3SFYdbOYSjfBpiKvFecSXY9qobTGh6lu/nO/5PMEm9dgmxng5hvBYaHk+7yJl6zhNzV1j30tX0zf4S/c79ZXIouQC91vsrDEAqQNMhVRM9PWcGWttkocTmQaJib9dHL9oleekNAoqftFji/7TLwVnsVgC8wrTx85X9atXdvwIOU+44p1yFVwz9Xvy2KwRAm06WxhPiaG0rtxCy89qskyzbXAB51qfjZNYCW84r3Wtmo442q/F1G/Q9udeT/IjIAQN3VsQlIaTVb8YgQqJft52t+1Ag6j9ZNP8riZu9ZGCc= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39850400004)(346002)(396003)(376002)(136003)(46966006)(36840700001)(47076005)(26005)(36860700001)(81166007)(55016002)(9686003)(70206006)(4326008)(356005)(186003)(70586007)(83380400001)(7696005)(478600001)(86362001)(966005)(8676002)(53546011)(6506007)(33656002)(336012)(110136005)(54906003)(316002)(82310400003)(6636002)(82740400003)(2906002)(52536014)(8936002)(5660300002)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2021 08:33:34.1647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6a6c360-d717-4eed-b9a7-08d93f8f93c5 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4377 Subject: Re: [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" > -----Original Message----- > From: Thomas Monjalon > Sent: Monday, July 5, 2021 3:30 PM > To: Honnappa Nagarahalli ; Ruifeng Wang > > Cc: dev@dpdk.org; bruce.richardson@intel.com; > konstantin.ananyev@intel.com; dev@dpdk.org; > david.marchand@redhat.com; David Christensen ; > nd > Subject: Re: [dpdk-dev] atomic operations >=20 > 05/07/2021 09:00, Ruifeng Wang: > > From: Thomas Monjalon > > > 03/07/2021 13:29, Thomas Monjalon: > > > > 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 patch= es > that > > > > need to be merged in 20.08 onwards. This change will not introduc= e > 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 degradati= on. > > > > " > > > > > > The only new wrapper is rte_atomic_thread_fence(). What else? > > > > Yes. The decision was to use GCC atomic built-ins directly. > > And rte_atomic_thread_fence() is an exception. It is a wrapper of > __atomic_thread_fence(), because mem order __ATOMIC_SEQ_CST has an > optimized implementation for x86. >=20 > Then above deprecation is wrong. >=20 > > > We are missing clear recommendations. > > > > > > > Should we keep these notifications forever? > > > > Targeting to obsolete APIs rte_atomicNN_xxx and rte_smp_*mb. > > Arm is working on replace occurrences with equivalent atomic built-ins. > > There is still a lot work to do in drivers. >=20 > This is an ongoing work. > In the meantime we need clear recommendation what to use. >=20 > > > > It is very difficult to find which wrapper to use. > > > > > > We should make function names explicit instead of "These". > > > > > > > This is the guide we have: > > > > https://doc.dpdk.org/guides/prog_guide/writing_efficient_code.html > > > > #loc > > > > ks-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. > > > > > > Precision: I meant "there is *no* example". > > > > > > > Please who could work on improving the documentation? > > > > Agree that the documentation needs improve. > > Add link to list of atomic built-ins and the above mentioned blog posts= can > be part of the improvement. >=20 > It should be more than a link. > We need to know when to use what. >=20 > First thing, please fix the deprecation notice. Sure. Will update deprecation notice with more accurate information. >=20 > > > One simple example: increment a counter atomically. > > > __atomic_fetch_add(&counter, 1, __ATOMIC_RELAXED); or > > > __atomic_add_fetch(&counter, 1, __ATOMIC_RELAXED); >=20 > I really hate how atomics are "documented" in GCC doc. > For instance, it doesn't say what is returned (old or new value) in above > functions. >=20 Returns are described as "the result of the operation" and "the value that = had previously been in *ptr". It can be more concise.