From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2BFEFA00E6 for ; Tue, 19 Mar 2019 09:31:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E7701DBD; Tue, 19 Mar 2019 09:31:09 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40070.outbound.protection.outlook.com [40.107.4.70]) by dpdk.org (Postfix) with ESMTP id 5797F11A4 for ; Tue, 19 Mar 2019 09:31:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gxd/z0IY3Pmiqbgpj+xYCHrdnVgXD/jJotsFRyuXiQ4=; b=jz8b+7VFD8PTYv8hwBE6FD3GgGnrM8h1m5hHYE6Qew5725N2Civ1DyX7IQw5OiN5PeswYjcxLQtu9f+kAeendnLdecGGvbcLUOVW5tJ3nAsyeDp7l0qQhgKDDKAh/tBL9KQ8aPxSEmLpzhv2QowgOaOnid6vt1+o6XgBvIMf0BU= Received: from VI1PR08MB3167.eurprd08.prod.outlook.com (52.133.15.142) by VI1PR08MB3071.eurprd08.prod.outlook.com (52.133.15.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Tue, 19 Mar 2019 08:31:06 +0000 Received: from VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::707a:b455:dcb2:9d40]) by VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::707a:b455:dcb2:9d40%2]) with mapi id 15.20.1709.015; Tue, 19 Mar 2019 08:31:06 +0000 From: "Gavin Hu (Arm Technology China)" To: "Ananyev, Konstantin" , "Joyce Kong (Arm Technology China)" , "dev@dpdk.org" CC: nd , "jerinj@marvell.com" , "chaozhu@linux.vnet.ibm.com" , "Richardson, Bruce" , "thomas@monjalon.net" , "hemant.agrawal@nxp.com" , Honnappa Nagarahalli Thread-Topic: [PATCH v3 1/3] rwlock: reimplement with atomic builtins Thread-Index: AQHU2mgBXSwg4k2RNUabDHBbBDzeK6YMky8AgAYT6UA= Date: Tue, 19 Mar 2019 08:31:05 +0000 Message-ID: References: <1544672265-219262-2-git-send-email-joyce.kong@arm.com> <1552569304-74817-2-git-send-email-joyce.kong@arm.com> <2601191342CEEE43887BDE71AB977258013655BF2A@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258013655BF2A@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2782fb7f-3fbb-4a7c-8ee7-08d6ac453aee x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB3071; x-ms-traffictypediagnostic: VI1PR08MB3071: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(13464003)(189003)(199004)(71190400001)(8676002)(71200400001)(81156014)(81166006)(6436002)(256004)(99286004)(97736004)(305945005)(6246003)(53936002)(2501003)(229853002)(9686003)(102836004)(7696005)(55016002)(14454004)(76176011)(52536014)(5660300002)(66066001)(446003)(25786009)(4326008)(8936002)(476003)(486006)(11346002)(86362001)(316002)(68736007)(478600001)(6506007)(3846002)(55236004)(7736002)(33656002)(54906003)(2906002)(26005)(110136005)(53546011)(74316002)(72206003)(105586002)(186003)(106356001)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3071; H:VI1PR08MB3167.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: orSSlQJhiZXJletjkfkhCLkbospakmQwkxXVif/HZjSLwZKWIzMnAkpRs8+/8384oPd+UJJV/AAwfKK0fAiHW3OzabzhkoPAF+c1hpbqiqa22OmqaIchZtx1WcJqzK7cyJNvxD8H5eHi7BfKlQ2FX15CtJ54cTGWWiTvaEZgS6taHyj6ZZx3WNG46NecsOd4IIt1/2Dkbc0CzILR8Ihd5+YNtbDC0QHz6rNCEfvwZmOkrpw4EJ1b5CR2q+DerJVjopdGWKMTSzvTDgYijEO65VB1HTSEen6tofAF4GWPUEeBdbeyyBRPhEn0a3AlsN9VdXhTNL5n+oal1Zv5XhByNhmd8KajIrBohB8Fl+9pybcwnShqytD+RBPJowu7fMKgKqDVEccJq1mbqfUxcUvCZdlFL8IMz2WWtBkbxLudqi0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2782fb7f-3fbb-4a7c-8ee7-08d6ac453aee X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2019 08:31:05.9776 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3071 Subject: Re: [dpdk-dev] [PATCH v3 1/3] rwlock: reimplement with atomic builtins 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" Message-ID: <20190319083105.HDKOWzHhf-7abH1zdn961UbisZ0L0K8cSr_RdQHE_uc@z> Hi Konstantin,=20 > -----Original Message----- > From: Ananyev, Konstantin > Sent: Friday, March 15, 2019 7:41 PM > To: Joyce Kong (Arm Technology China) ; > dev@dpdk.org > Cc: nd ; Gavin Hu (Arm Technology China) > ; jerinj@marvell.com; chaozhu@linux.vnet.ibm.com; > Richardson, Bruce ; thomas@monjalon.net; > hemant.agrawal@nxp.com; Honnappa Nagarahalli > > Subject: RE: [PATCH v3 1/3] rwlock: reimplement with atomic builtins >=20 > Hi, >=20 >=20 > > The __sync builtin based implementation generates full memory > > barriers ('dmb ish') on Arm platforms. Using C11 atomic builtins > > to generate one way barriers. > > > > Here is the assembly code of __sync_compare_and_swap builtin. > > __sync_bool_compare_and_swap(dst, exp, src); > > 0x000000000090f1b0 <+16>: e0 07 40 f9 ldr x0, [sp, #8] > > 0x000000000090f1b4 <+20>: e1 0f 40 79 ldrh w1, [sp, #6] > > 0x000000000090f1b8 <+24>: e2 0b 40 79 ldrh w2, [sp, #4] > > 0x000000000090f1bc <+28>: 21 3c 00 12 and w1, w1, #0xffff > > 0x000000000090f1c0 <+32>: 03 7c 5f 48 ldxrh w3, [x0] > > 0x000000000090f1c4 <+36>: 7f 00 01 6b cmp w3, w1 > > 0x000000000090f1c8 <+40>: 61 00 00 54 b.ne 0x90f1d4 > > // b.any > > 0x000000000090f1cc <+44>: 02 fc 04 48 stlxrh w4, w2, [x0] > > 0x000000000090f1d0 <+48>: 84 ff ff 35 cbnz w4, 0x90f1c0 > > > > 0x000000000090f1d4 <+52>: bf 3b 03 d5 dmb ish > > 0x000000000090f1d8 <+56>: e0 17 9f 1a cset w0, eq // eq =3D n= one > > > > Signed-off-by: Gavin Hu > > Tested-by: Joyce Kong > > Acked-by: Jerin Jacob > > --- >=20 > Wouldn't it be plausible to change _try_ functions to use __atomic too (f= or > consistency)? > Apart from that looks good to me. > Konstantin Sure, we will do it in next version.=20