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 E09A7A0597; Wed, 8 Apr 2020 12:15:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE71A1C0B6; Wed, 8 Apr 2020 12:15:53 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10053.outbound.protection.outlook.com [40.107.1.53]) by dpdk.org (Postfix) with ESMTP id 10AC71BFC4 for ; Wed, 8 Apr 2020 12:15:53 +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=vQ3lm1myJ987tSZuLzm4XpbVph8/RDtQG/+m/3eq6Xg=; b=Qq3MYLl736uoUIOEYAtIUDoufG7WWPFQG0KEOazEJnf5JCtx0pQh0y3o0bEtEpbDXfvo3/7cT76hpNGHlRbFJM9avpOquV469bXv9LV+VXqyiFMwPZ9St27dlnnTSPTgmQnzuuW7HfXbtf9uCr0AQ4wVHDwTOnYBxXsLdBh2dtU= Received: from AM7PR03CA0019.eurprd03.prod.outlook.com (2603:10a6:20b:130::29) by DB8PR08MB4186.eurprd08.prod.outlook.com (2603:10a6:10:b1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15; Wed, 8 Apr 2020 10:15:51 +0000 Received: from AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:130:cafe::5a) by AM7PR03CA0019.outlook.office365.com (2603:10a6:20b:130::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Wed, 8 Apr 2020 10:15:50 +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 AM5EUR03FT026.mail.protection.outlook.com (10.152.16.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Wed, 8 Apr 2020 10:15:50 +0000 Received: ("Tessian outbound e2c88df8bbbe:v50"); Wed, 08 Apr 2020 10:15:50 +0000 X-CR-MTA-TID: 64aa7808 Received: from 6622fcf879c4.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 151CABDA-7075-4E5F-B8FD-9C75C4A15B6B.1; Wed, 08 Apr 2020 10:15:45 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6622fcf879c4.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Apr 2020 10:15:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W9EblkSrM77DvvLg2bFvGmYGSOA0JTqGjOafJAQLDUM0itg/q6fxOMGziHNfc31Hx8unXz6NzTZKYOoQ1TwRAc8l3pQ5+ClDI4CnZ+q9WhPiF0OCToAd0qXdzPzhUmuUSYEk9ra6N1WVlmTlmsfCnTH/6lBOpTRq4Vj4O6DWVUEqcjgsmVzJ4ymzdezHeTdnHQMgVgFOd8UolXaFXlOaBVanzi/EgiQ4xeX+rIxUXbiufuHAw27NN3wf688z9DsRk3x98kvu0JlDhvdCTz5Um5jiLeKRJRSMzSoPN34GV3FW+pP8BEClNkL+6EQTcfu401AdnQX8iBjS8XBaYbqWLA== 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=vQ3lm1myJ987tSZuLzm4XpbVph8/RDtQG/+m/3eq6Xg=; b=HEY+525LOu/wxvOD+KsaRfDi0ICPUTLUI4EOeUWpSLV1n2FCGAYxlXqzVjVllEPxJwGB4fHmdUdhpCaQ8N5X3oCbR8NvT1f08fHhrj9YGaws5vgonyZeMbUvgLqRweuR6SkwmI7aQcum7TfMHYZX1mCB4iduxEmcfPWSVpmETFj6rE0gIZ8xU8E00XzFMuoqj/1+eTSaGX/takxhXDTgtk+eKcrO0JS2O3FDdxxehar72DFYvNoExiFQOa2gPvvPNxwiHiksqbhsdGPBWZHcbCJhysB4h3ZzZIyGo7EBX+04OWcRvH1jkKqYIyxDeoLtxj+CpQ4lb5/HKYQ0Z7p6Xg== 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=vQ3lm1myJ987tSZuLzm4XpbVph8/RDtQG/+m/3eq6Xg=; b=Qq3MYLl736uoUIOEYAtIUDoufG7WWPFQG0KEOazEJnf5JCtx0pQh0y3o0bEtEpbDXfvo3/7cT76hpNGHlRbFJM9avpOquV469bXv9LV+VXqyiFMwPZ9St27dlnnTSPTgmQnzuuW7HfXbtf9uCr0AQ4wVHDwTOnYBxXsLdBh2dtU= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (10.255.27.75) by VE1PR08MB4687.eurprd08.prod.outlook.com (10.255.113.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.20; Wed, 8 Apr 2020 10:15:43 +0000 Received: from VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::7df3:e3c8:54f7:57c2]) by VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::7df3:e3c8:54f7:57c2%6]) with mapi id 15.20.2878.021; Wed, 8 Apr 2020 10:15:43 +0000 From: Phil Yang To: "Van Haaren, Harry" , "thomas@monjalon.net" , "Ananyev, Konstantin" , "stephen@networkplumber.org" , "maxime.coquelin@redhat.com" , "dev@dpdk.org" CC: "david.marchand@redhat.com" , "jerinj@marvell.com" , "hemant.agrawal@nxp.com" , Honnappa Nagarahalli , Gavin Hu , Ruifeng Wang , Joyce Kong , nd , nd Thread-Topic: [PATCH v3 11/12] service: optimize with c11 one-way barrier Thread-Index: AQHWCa8yVth6YwPdgkyn+P8/uGmapKhu+DQg Date: Wed, 8 Apr 2020 10:15:43 +0000 Message-ID: References: <1583999071-22872-1-git-send-email-phil.yang@arm.com> <1584407863-774-1-git-send-email-phil.yang@arm.com> <1584407863-774-12-git-send-email-phil.yang@arm.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 750e61c3-39e8-404d-8edc-b451d19f2442.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-originating-ip: [58.39.116.39] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c5ae7753-cf6b-412c-65a7-08d7dba5d020 x-ms-traffictypediagnostic: VE1PR08MB4687:|VE1PR08MB4687:|DB8PR08MB4186: 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:7219;OLM:7219; x-forefront-prvs: 0367A50BB1 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:(10009020)(4636009)(396003)(39860400002)(136003)(366004)(346002)(376002)(55016002)(478600001)(66556008)(66476007)(4326008)(71200400001)(26005)(110136005)(54906003)(316002)(5660300002)(9686003)(2906002)(66946007)(81166007)(64756008)(86362001)(66446008)(52536014)(76116006)(186003)(8936002)(6506007)(53546011)(8676002)(7696005)(33656002)(81156014); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6tIAn2/Iqyghiy65EKgY5SdzeqCjmBvfhlO1itg9djFjoH+ant2jsxQk5Y3084qh17KU2rXkuHXVP4F4Ri9JEegea3RptdS2aDpTwuZlK9u0m9Ue8d1ckQvOtsao+M+1y5fVOF3eBtFdE1D7pHQPca42LyWigU+bVJo6VVoB50rlVP2eLog3hFrPZrUZM/l3GlHRRc3ji04uOo16DSiCUe1Yw7VecloGtcMMOxMPO2FX3ajiaKMPHT7A/alNUWVZO9pHIEUGf4S4zoXlKgtUXFnqX6e8Q5KwK6xc2+F7v47QtbVd77nUt2jDtpHz8ZA06fpCp3PRNugsrPRTXAOQro2AH93TGo7v//bBX/02NcHSZ0OQohqQ8+5qkzJ9gR2Kr9WrcE2Te0c15fq0/ECYm8T2zWicEyhQypB5Aj2/g8JW2plvOsIgxP6lb45B/sy5 x-ms-exchange-antispam-messagedata: K2tYZheq3NnX60i6p2JluYNdw5mYI8mk/eeLMJYPdiJ82R6CxOtDDDUGip33r1bH3fsv8FyiR9UOzxwmijkbfx1CKnBdiE/ZkWwiSniSaeB4kZz12R2s0skD6rh5qESIWaows4h2zGmorpw+0Mcrpw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4687 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT026.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:(10009020)(4636009)(346002)(136003)(396003)(376002)(39860400002)(46966005)(4326008)(26005)(356004)(5660300002)(82740400003)(26826003)(81166007)(6506007)(47076004)(36906005)(55016002)(53546011)(336012)(7696005)(52536014)(33656002)(316002)(81156014)(2906002)(478600001)(8676002)(54906003)(186003)(110136005)(86362001)(70586007)(9686003)(70206006)(8936002); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 8646a6aa-1849-45de-22c8-08d7dba5cbeb X-Forefront-PRVS: 0367A50BB1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XBMrdwq4IaBKq+bv3I89ui4bBQptlhlGQC9IODNv3QJpdV++RAagE4fHh7MTYp2mN9Jpa/AgbpJoqFmC09lwK6uQ5QCnhzJV+l7deFwFVrCVt/G3oZOmm0SmW7eMGFRZDsOMfgL0G0dNChu1FpPu7IXiyaxumY0YiK1waNhYi+ZLPymP16ggvtHal43ca6Gb/5W2zxVcWXa8b5cF0pToz6bAdnPjmjgZlOCItZamJyAfhM1ETnEgHjnLOGVn83PBHuI0gQNiokevT9VLattYTssc7pgdtx4LRhvPxfyOgwkV1ULjYTGQA9S15D5Oc3+ouc6ZWk+ZKa87D8kmdnOAdKaMI1kfyVTU8umj8pb6FJCy42U3tqODhLxQswtW29wUIyPPCjpxrTP7AmXCXYZ05a4dNZ4LooNesx5PLf8nJgUgyYIni11UzGfFQ+l39BbK6P2mX9JgnSuPQoRNQLBqwrxLNXJ86y/xKhxtfluI5WQqWENaYgi5Bz3w/zkK+4SEoUN+PoLT/2NFjLoziG57Ug== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2020 10:15:50.3494 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5ae7753-cf6b-412c-65a7-08d7dba5d020 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: DB8PR08MB4186 Subject: Re: [dpdk-dev] [PATCH v3 11/12] service: optimize with c11 one-way barrier 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" > -----Original Message----- > From: Van Haaren, Harry > Sent: Friday, April 3, 2020 7:58 PM > To: Phil Yang ; thomas@monjalon.net; Ananyev, > Konstantin ; > stephen@networkplumber.org; maxime.coquelin@redhat.com; > dev@dpdk.org > Cc: david.marchand@redhat.com; jerinj@marvell.com; > hemant.agrawal@nxp.com; Honnappa Nagarahalli > ; Gavin Hu ; > Ruifeng Wang ; Joyce Kong > ; nd > Subject: RE: [PATCH v3 11/12] service: optimize with c11 one-way barrier >=20 > > -----Original Message----- > > From: Phil Yang > > Sent: Tuesday, March 17, 2020 1:18 AM > > To: thomas@monjalon.net; Van Haaren, Harry > ; > > Ananyev, Konstantin ; > > stephen@networkplumber.org; maxime.coquelin@redhat.com; > dev@dpdk.org > > Cc: david.marchand@redhat.com; jerinj@marvell.com; > hemant.agrawal@nxp.com; > > Honnappa.Nagarahalli@arm.com; gavin.hu@arm.com; > ruifeng.wang@arm.com; > > joyce.kong@arm.com; nd@arm.com > > Subject: [PATCH v3 11/12] service: optimize with c11 one-way barrier > > > > The num_mapped_cores and execute_lock are synchronized with > rte_atomic_XX > > APIs which is a full barrier, DMB, on aarch64. This patch optimized it = with > > c11 atomic one-way barrier. > > > > Signed-off-by: Phil Yang > > Reviewed-by: Ruifeng Wang > > Reviewed-by: Gavin Hu > > Reviewed-by: Honnappa Nagarahalli >=20 > Based on discussion on-list, it seems the consensus is to not use > GCC builtins, but instead use C11 APIs "proper"? If my conclusion is > correct, the v+1 of this patchset would require updates to that style API= . >=20 > Inline comments for context below, -Harry >=20 >=20 > > --- > > lib/librte_eal/common/rte_service.c | 50 > ++++++++++++++++++++++++++---------- > > - > > 1 file changed, 35 insertions(+), 15 deletions(-) > > > > diff --git a/lib/librte_eal/common/rte_service.c > > b/lib/librte_eal/common/rte_service.c > > index 0843c3c..c033224 100644 > > --- a/lib/librte_eal/common/rte_service.c > > +++ b/lib/librte_eal/common/rte_service.c > > @@ -42,7 +42,7 @@ struct rte_service_spec_impl { > > * running this service callback. When not set, a core may take the > > * lock and then run the service callback. > > */ > > - rte_atomic32_t execute_lock; > > + uint32_t execute_lock; > > > > /* API set/get-able variables */ > > int8_t app_runstate; > > @@ -54,7 +54,7 @@ struct rte_service_spec_impl { > > * It does not indicate the number of cores the service is running > > * on currently. > > */ > > - rte_atomic32_t num_mapped_cores; > > + int32_t num_mapped_cores; >=20 > Any reason why "int32_t" or "uint32_t" is used over another? > execute_lock is a uint32_t above, num_mapped_cores is an int32_t? It should be uint32_t for num_mapped_cores.=20 This value will not be negative after __atomic_sub_fetch operation, because= of the sequence of writer and reader accesses are guaranteed by the memory= ordering. I will update it in the next version. Thanks, Phil