From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4D2EA04A2; Tue, 12 May 2020 10:18:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA17C1C042; Tue, 12 May 2020 10:18:48 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60058.outbound.protection.outlook.com [40.107.6.58]) by dpdk.org (Postfix) with ESMTP id 847551C020 for ; Tue, 12 May 2020 10:18:47 +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=cfR4y1lIA31+oqk2YC220iLY/Ld1IKYMu9vsUZDZ/2o=; b=chAB+vosB7/n7XpshSZUJ3TlE1eejLQO8LTYY33DO/6V5f+T3OayqkfiSfcrSukgB3N/a3lMwfpN6GIYj61mCEzr5tDkqSGXbArgiMhCbdv+URjI+wYqtnFh+XXu7x63rVwH8XjmdN3N3jbxo29eGai7EHVGvb/99sl56uNCqEY= Received: from AM6PR05CA0034.eurprd05.prod.outlook.com (2603:10a6:20b:2e::47) by VI1PR08MB3373.eurprd08.prod.outlook.com (2603:10a6:803:7b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.30; Tue, 12 May 2020 08:18:44 +0000 Received: from AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2e:cafe::ad) by AM6PR05CA0034.outlook.office365.com (2603:10a6:20b:2e::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 08:18:44 +0000 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=bestguesspass 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 AM5EUR03FT046.mail.protection.outlook.com (10.152.16.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 08:18:44 +0000 Received: ("Tessian outbound e88319d7ccd0:v54"); Tue, 12 May 2020 08:18:44 +0000 X-CR-MTA-TID: 64aa7808 Received: from 6a93a9aad197.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BD7A06F5-0143-4864-9B35-143F7D73E685.1; Tue, 12 May 2020 08:18:39 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6a93a9aad197.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 08:18:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m/H4gMzRG0Ko8I9lDhaNTRL3KyqqDUPIItl58YM4TxpYNAQbuZFQnuJCDt8QwDlpBZRUzg73quXrl6Zt2LLiYCOgA9quYgGjvnGzLZDuxkzt47+oYxepckc/YyxTQJdMH/L3hAKyz7mQqkBcpc06DTdDC9g3k667XIi7ULypZZUqnvaGyf9oqKU6QpIgXz81lmR31xQBEhAOnVs1+5O3pB3V9jZBlCFycz7NeaCL5fdXwcNm84Z4GR8GfPy7VmfJ7tp76z5xWifIxPJA9WJD4qNx3Hh3q/K86odfCt9UfeOKOb5d30Z1inVyXUlQnKwMxpK4bPwuoCnn1kWXRNeL1Q== 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=cfR4y1lIA31+oqk2YC220iLY/Ld1IKYMu9vsUZDZ/2o=; b=RUsYK+1BrXxwDJwi4K/ALeaQjcRziNdvEdO+plsNBGnrHySSE8YIVCjGvmQsK74qnP2FWhummqCvYMgMz86ZZoEFjJbsJIWu82geiCTgYWFWOdHEHb9aThMvHZVaR3NS5klJ61yQf4nBW79Uw3Z6jozeBg0HakJoD6xCJJmDHY7Be3cy8Amd9DQSHu+OpteVVkijTMuf/CPjYlNxWImfrWHsXnv+zaeRDTL+SAh7hO24eRqax7HFD6mbw6STrxMPraEsUkAGDYPgHW3Zb1jZsql7+V9x9zJza5Zd9L46EHwETGY2YunDBspfrrkfgdTIZgOMtZ78WGZtHXpBMzLT5g== 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=cfR4y1lIA31+oqk2YC220iLY/Ld1IKYMu9vsUZDZ/2o=; b=chAB+vosB7/n7XpshSZUJ3TlE1eejLQO8LTYY33DO/6V5f+T3OayqkfiSfcrSukgB3N/a3lMwfpN6GIYj61mCEzr5tDkqSGXbArgiMhCbdv+URjI+wYqtnFh+XXu7x63rVwH8XjmdN3N3jbxo29eGai7EHVGvb/99sl56uNCqEY= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VE1PR08MB4798.eurprd08.prod.outlook.com (2603:10a6:802:a2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Tue, 12 May 2020 08:18:34 +0000 Received: from VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::785b:54ca:be80:7b66]) by VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::785b:54ca:be80:7b66%2]) with mapi id 15.20.2979.033; Tue, 12 May 2020 08:18:33 +0000 From: Phil Yang To: Phil Yang , "thomas@monjalon.net" , "dev@dpdk.org" CC: "bruce.richardson@intel.com" , "ferruh.yigit@intel.com" , "hemant.agrawal@nxp.com" , Honnappa Nagarahalli , "jerinj@marvell.com" , "ktraynor@redhat.com" , "konstantin.ananyev@intel.com" , "maxime.coquelin@redhat.com" , "olivier.matz@6wind.com" , "stephen@networkplumber.org" , "mb@smartsharesystems.com" , "mattias.ronnblom@ericsson.com" , "harry.van.haaren@intel.com" , "erik.g.carrillo@intel.com" , nd , David Christensen , nd Thread-Topic: [PATCH v4 0/4] generic rte atomic APIs deprecate proposal Thread-Index: AQHWKDPpTuzLCSjgXkWGzwx5qNNQ5qikGbnA Date: Tue, 12 May 2020 08:18:33 +0000 Message-ID: References: <1584407863-774-1-git-send-email-phil.yang@arm.com> <1589270586-4480-1-git-send-email-phil.yang@arm.com> In-Reply-To: <1589270586-4480-1-git-send-email-phil.yang@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 52e8d7cb-0d5f-4015-9720-69bda12993fe.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f633f4e5-ed10-419d-e073-08d7f64d1642 x-ms-traffictypediagnostic: VE1PR08MB4798:|VE1PR08MB4798:|VI1PR08MB3373: 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:9508;OLM:9508; x-forefront-prvs: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6PGbC+U68xklI36L+8jaWRm5KMxWem1P0LZZZb6Ipza04eHqsn6mapQwWGfgr3PnLi9wN4OEwuf2J80uylYhuy0mpUJPEiBEapbZz2FjaOdVvrrIsQVoZZNl1NWXXPA3dtQpItVaICKdO/zv4GTIvUogf8mhKiZ5Kqwnr6CmFnNL38TIkugkmKBaU/88ylY9zqoCEWEnhqKKtT0qlP6shZq7x/4aVI85+4Bk7a4JaoK5SjzKlb3bpBkFw/10T5v+ch80pUat8SJNT2am4HlqutKnbN4KoBrapCVYeatvMuVAwcuR9CIOybzGFqhuAX1v3tbfq9uLRLOJ9X/J2v+ISpC00Lrce27KXbcQS2cOusKrWmnFa62nwqJo7ByUEdAc02goWcAjeSyH8PSm9sQPNNYqIfii8iEII9vAOnLILUuV0pBkxKXl/M97I5+nKW28ajPuG5QIKITpLN4e89NvJx0jjKzwDz63P1q1ybhZHhcpAIpLcyNsb/bLHsm1O026IvXdki9My+AM6B3wQWQ5cHhCKktelOPYaxftVutlo4iGb/7GATYnv8lD6rM/UqfHdxWRAoc7y8xEk0oZ0Yd6ng== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4640.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(39860400002)(346002)(376002)(366004)(33430700001)(66446008)(66476007)(64756008)(66946007)(71200400001)(76116006)(66556008)(33440700001)(8936002)(86362001)(186003)(4326008)(26005)(5660300002)(8676002)(7416002)(9686003)(478600001)(2906002)(316002)(33656002)(110136005)(53546011)(6506007)(55016002)(55236004)(52536014)(7696005)(54906003)(41533002)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: NHJ+omiwwgJDtgSoc+GIEi4HnXYrwigkgI+zRPqc+AXV9JhqZIvF3N0yKb1AGY0SN3OWh7GmifL/504uKjRaegf2qW0q1mxzKPbeUMfwkRoSiPTnMalFemmTYXACyLY86DeB61kWjmG8BQ6zoQ9Kb/L2AbtnkL/dSWRnRsxKx6yiFjpFsnyREOIgWJ5fxchlthbOqIgZw8RJ9dnNLQ8Gr65D8u9KgK7XR128LolS9E0O4SbsErKC46KIPM7/J//nfL8pp6rnLmzICQZ0xnHzUEO1JKcP+0RRI8joaoPJLSb+lX3P3Ek2Y4cK0Pa0iCCxKkdCYMR6K/pyh/RcfRoaBeGTl2QyKeElieXJ3V/ilWmmbMsyoiMv2fkHkHX7kriMdkZW9wG9ZseeOa+lHv/EcDzHf+ZAnMWRUDJ70ZFIcMfE5TySczm2MGGwt+xeL3pY92m9fQzl3qledkHSKVfR1nTZ6pVXeulmJbsDGaVLVEQ= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4798 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(136003)(346002)(39860400002)(376002)(396003)(46966005)(33430700001)(53546011)(478600001)(81166007)(82740400003)(47076004)(86362001)(356005)(70586007)(316002)(6506007)(36906005)(110136005)(8676002)(52536014)(8936002)(70206006)(54906003)(2906002)(4326008)(33440700001)(7696005)(336012)(55016002)(9686003)(33656002)(5660300002)(186003)(26005)(82310400002)(41533002)(21314003); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 509ec70b-6202-4483-68e8-08d7f64d101f X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SzEtX8IHk2CH5hA6KPya8QgcNrsiP8EVilPttmgmiYZHoTeaC7UwSX6hFbLsYOANxL/g0XzRVaRpNM+EIwEhYEoi8XCRnt+ov86RkFk9sd0tGHjnAkd27mHdMbWiJIhpTPejD65I5dap7RPyIex2QB8JJY3S5zFVxC6UzZTO/wvx/20b6kJZJPGxZaEwIGFnxTadAh3/hidmm5U5znC7h1A4nee0ve3gimKfQ+6EbhwJL8xDHkUMXmx2JdTvhYVW3Ix7N9R8G6fD5KOn5CtiWO9jiiid/rdruaqTJKsoPeO9xNyHgte3LLn8ubzMHXyoW5KfG51nhOm/C8omd6NCbagSBhgBl42B+IClRosasZyCpUgmQNecQE4v7PpqPVqI6oBLPoWCvrWtFbpQ3YbuqcNOmZAlxZXM7ZPj5jPQF9m7eUAOYR/0PttXptv8R0qOzMYxFzg9RAMfypn0cjSyqbDOPQ78Eu5aaBNCQLOgpYMPHTc63y+E6SUvT/uIHH+pPWNxWC3kMIi7Wx2mA5Ug6VXWIFQt1RqPv+YpclmMp7g/UQ4AcuKM+/1VMelXvqk/bWzmwMjhVHJaYghDGj0jCaQSg5eSl/FanGC+I6WN14j8ubyp4W+buUNVg4vc7xfP X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 08:18:44.1901 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f633f4e5-ed10-419d-e073-08d7f64d1642 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3373 Subject: Re: [dpdk-dev] [PATCH v4 0/4] generic rte atomic APIs deprecate proposal X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" + David Christensen The PPC c11 atomics maintainer. My apologies, I forgot to cc you on this email. Thanks, Phil Yang > -----Original Message----- > From: Phil Yang > Sent: Tuesday, May 12, 2020 4:03 PM > To: thomas@monjalon.net; dev@dpdk.org > Cc: bruce.richardson@intel.com; ferruh.yigit@intel.com; > hemant.agrawal@nxp.com; Honnappa Nagarahalli > ; jerinj@marvell.com; > ktraynor@redhat.com; konstantin.ananyev@intel.com; > maxime.coquelin@redhat.com; olivier.matz@6wind.com; > stephen@networkplumber.org; mb@smartsharesystems.com; > mattias.ronnblom@ericsson.com; harry.van.haaren@intel.com; > erik.g.carrillo@intel.com; Phil Yang ; nd > Subject: [PATCH v4 0/4] generic rte atomic APIs deprecate proposal >=20 > DPDK provides generic rte_atomic APIs to do several atomic operations. > These APIs are using the deprecated __sync built-ins and enforce full > memory barriers on aarch64. However, full barriers are not necessary > in many use cases. In order to address such use cases, C language offers > C11 atomic APIs. The C11 atomic APIs provide finer memory barrier control > by making use of the memory ordering parameter provided by the user. > Various patches submitted in the past [2] and the patches in this series > indicate significant performance gains on multiple aarch64 CPUs and no > performance loss on x86. >=20 > But the existing rte_atomic API implementations cannot be changed as the > APIs do not take the memory ordering parameter. The only choice available > is replacing the usage of the rte_atomic APIs with C11 atomic APIs. In > order to make this change, the following steps are proposed: >=20 > [1] deprecate rte_atomic APIs so that future patches do not use rte_atomi= c > APIs (a script is added to flag the usages). > [2] refactor the code that uses rte_atomic APIs to use c11 atomic APIs. >=20 > This patchset contains: > 1) changes to programmer guide describing writing efficient code for aarc= h64. > 2) the checkpatch script changes to flag rte_atomicNN_xxx API usage in > patches. > 3) wraps up compiler __atomic built-ins with explicit memory ordering > parameter. >=20 > v4: > 1. add reader-writer concurrency case describing. > 2. claim maintainership of c11 atomics code for each platforms. > 3. flag rte_atomicNN_xxx in new patches for modules that have been > converted to > c11 style. > 4. flag __sync_xxx built-ins in new patches. > 5. wraps up compiler atomic built-ins > 6. move the changes of libraries which make use of c11 atomic APIs out of > this > patchset. >=20 > v3: > add libatomic dependency for 32-bit clang >=20 > v2: > 1. fix Clang '-Wincompatible-pointer-types' WARNING. > 2. fix typos. >=20 >=20 > Phil Yang (4): > doc: add generic atomic deprecation section > maintainers: claim maintainers of c11 atomics code > devtools: prevent use of rte atomic APIs in future patches > eal/atomic: add wrapper for c11 atomics >=20 > MAINTAINERS | 4 + > devtools/checkpatches.sh | 23 ++++ > doc/guides/prog_guide/writing_efficient_code.rst | 139 > ++++++++++++++++++++++- > lib/librte_eal/include/generic/rte_atomic_c11.h | 139 > +++++++++++++++++++++++ > lib/librte_eal/include/meson.build | 1 + > 5 files changed, 305 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_eal/include/generic/rte_atomic_c11.h >=20 > -- > 2.7.4