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 6E3A2A0C4A; Thu, 8 Jul 2021 11:41:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5811E415C9; Thu, 8 Jul 2021 11:41:30 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80040.outbound.protection.outlook.com [40.107.8.40]) by mails.dpdk.org (Postfix) with ESMTP id E1984415C2 for ; Thu, 8 Jul 2021 11:41:28 +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=N0gvzbNnhqJZBHFnZYTa69aDdTh25JPWFkVS9BCUUmg=; b=5oKCJSven1aXketYxN+cmJV90l4FeW3ZGxWGGWeVPR5WYQywk/djm554N3SSQqmiWIbpZPm0EdJod96KpktjAwkuYfml7kIUw+9nkjbVVX622GtuIJsyIRfIoZuUS7S8PyLHsH3qI3pCeKg2IC3C3ginNW17F36GzsDttC4QJa8= Received: from AS8PR04CA0158.eurprd04.prod.outlook.com (2603:10a6:20b:331::13) by AS8PR08MB6567.eurprd08.prod.outlook.com (2603:10a6:20b:318::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18; Thu, 8 Jul 2021 09:41:28 +0000 Received: from VE1EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:331:cafe::a4) by AS8PR04CA0158.outlook.office365.com (2603:10a6:20b:331::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22 via Frontend Transport; Thu, 8 Jul 2021 09:41:27 +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 VE1EUR03FT009.mail.protection.outlook.com (10.152.18.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Thu, 8 Jul 2021 09:41:27 +0000 Received: ("Tessian outbound 17c2a40a31ce:v98"); Thu, 08 Jul 2021 09:41:27 +0000 X-CR-MTA-TID: 64aa7808 Received: from da72d3acb87f.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 25DA0C8B-E620-410C-8C22-37C429D30EA0.1; Thu, 08 Jul 2021 09:41:17 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id da72d3acb87f.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 08 Jul 2021 09:41:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RYMeUgCHe+O9ISMBFdovLXJNliHzJSlk4xPAfTUo3GkAFplg127a2qXWj7Oloyw/l8lgmhUEW3uSsFXepsQaDDa7MLa+7JQk9EWfo4qBl3v2lNHCsAfzhcEKKJnQtJkrjT8ahz++HDIn5FAe8X8N5L9Nqt+MEVg4hh6OC9CAVylKc7BVuC2JtBuUZVnLTX4I7UUVPeHdSxHBkw2uaIjBoobRJHvNZehHxtmGlBfjx0KWoXedKfO8q/ndgN95QzgGbr7GnR+zSn7GL3lJ/Cp+BD5NMlMYKiUB79Q5eBFebea0ajwgn3X9qpIdAsASsZtJGPRyUV9weivMjoyICG+Bcg== 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=N0gvzbNnhqJZBHFnZYTa69aDdTh25JPWFkVS9BCUUmg=; b=ZdaJpEZHRQGErH72NEepp3UXyhPPAvOn0RA2kwar8XF3wYeoRLOmbgRDDAaw9fqkVSAfEAhHpzQ+bt9wqZA+zbdpAlnBazgzHL2CxhIHm+WVlK/zLJ18pZ51MdjNzJGkygCVFFqTsicVUbdWQ7W30u4VTAFXtBi34Ex3OQfH9i9mdhFekFovYMQxoBPwDT6uLWCgBHEafjWFg++Vr5KO96WFLtwC3byay32GDAoRO5cB+jfgCuPYkz9kXhauzXTBZ4nXLlVv5MNKwpYfjE/gualtGGKSHPEQQPcOaXnTgpZID5jqOf62C3a4BQ1FlpV42IQyo9t7WblDxRlRbHlFlw== 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=N0gvzbNnhqJZBHFnZYTa69aDdTh25JPWFkVS9BCUUmg=; b=5oKCJSven1aXketYxN+cmJV90l4FeW3ZGxWGGWeVPR5WYQywk/djm554N3SSQqmiWIbpZPm0EdJod96KpktjAwkuYfml7kIUw+9nkjbVVX622GtuIJsyIRfIoZuUS7S8PyLHsH3qI3pCeKg2IC3C3ginNW17F36GzsDttC4QJa8= Received: from AM5PR0802MB2465.eurprd08.prod.outlook.com (2603:10a6:203:9f::22) by AM6PR08MB3928.eurprd08.prod.outlook.com (2603:10a6:20b:a9::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.27; Thu, 8 Jul 2021 09:41:14 +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; Thu, 8 Jul 2021 09:41:14 +0000 From: Ruifeng Wang To: Stephen Hemminger CC: "dev@dpdk.org" , "david.marchand@redhat.com" , "thomas@monjalon.net" , "jerinj@marvell.com" , nd , Honnappa Nagarahalli , nd Thread-Topic: [dpdk-dev] Use WFE for spinlock and ring Thread-Index: AQHXOZfiEaONiOZqSEmnDJAtoLql+6s4Cu+AgAE3T5A= Date: Thu, 8 Jul 2021 09:41:14 +0000 Message-ID: References: <20200424070741.16619-1-gavin.hu@arm.com> <20210425055653.1509261-1-ruifeng.wang@arm.com> <20210707074751.2f3e53da@hermes.local> In-Reply-To: <20210707074751.2f3e53da@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 102378A7FC58E34F9FB137A6D0C4E980.0 x-checkrecipientchecked: true Authentication-Results-Original: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: dc6cc668-780c-497b-b7df-08d941f48f1b x-ms-traffictypediagnostic: AM6PR08MB3928:|AS8PR08MB6567: 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-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: PamzCbonwoo0JBaPJnB5lV6wm7+9dNDfrVuizHts++V6crso2Dnj0EzOyeBTyrp//gx2vciZw8q83b5ah5z4vNA93+5QuFzno7gpU0PtZAJ/Z/d+mWOSm42D1/TBTKtVEIrQTYsYhOsYnGRWPdr5IXY3eU3ZK/2fsHU6T+PGDaVKtM+Ixw2bRx4GTqupD3OAilZ3kW7MXzR5uuxhei7QFgIoE8Gc8lurtYfT4PGbxEQPFQ85os8jrvgt7yD6HgipLo2jOrhhmOxZ/hs1G4Mr2QMnHjsyzcrpuI65XAugtVBolHvEpuC+XxaQFBIFC2mUdMFIaXs8nHRVs1+4eWyzqJoWDjGaYmJrje3qCgbmRI5jDzDgeViPv8O34ru0OOqtTgOfvAORnSrEapp+itQfS+ReH7VxYUQtI1F1QBDbR8KBF9OEBp9oKn9tZ/69HLjhXG9TZE9nDpQHBLbDTfEewh7eoZ9JoDHHWMHh0iZI3O5KmxwpZWpF8xaJgMeZ9kKXr7ytloibE17Y4d1h1zxQ1qj/Cz0O4dwAMXlKx2orPJT/kBO13J5mhDRzsY8KWspuphmQl4xGqOsHEftmxKo2Yvf2ZBUcCvhU+OKxItU+ESvV53YYkasgHes4tyoIYFtBbRX4Tpv2EN8ipF/1izRkWGhLhQrZ8Qlg6TzS/kZBOppJMvuqnozjnjX2ajd6BDrpAELF4dulapNTT8pdJzgmVCgxby8MG1oaVKV/UFjLbQlqpFZ8zHX+mZ69zr/cpCVHwsFg+aVTZsLSIVt6F3h6rcYRqNKt8COHtRLLVj+cinQ= 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)(39850400004)(366004)(346002)(396003)(136003)(376002)(33656002)(2906002)(71200400001)(5660300002)(478600001)(52536014)(7696005)(122000001)(316002)(966005)(4326008)(6916009)(83380400001)(76116006)(66476007)(64756008)(66946007)(8676002)(38100700002)(66556008)(8936002)(186003)(9686003)(54906003)(66446008)(26005)(6506007)(55016002)(86362001)(53546011)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?w9AWquJZzGRsVfYKzaxhkSo3JbJubXlOIdQu+H1sqoaaMZ5/VGrPrAj/7UQl?= =?us-ascii?Q?TsjQ/inp1jZWQi3+GqKcRL3CJxliq0NeZtaZlmJIIE0j0FMTqJlZDONstgV0?= =?us-ascii?Q?1t/NgSXcpQFlhnQ+u6degODMNTEf8svQqyz/j/7FvHtDZ38ui3SE7M2Jfctz?= =?us-ascii?Q?AUJn+UtqwPCw8I2V3W2FjsnPb8/CCR8ddXt+JQ3TxKuJ730HScsE9h/JjpX+?= =?us-ascii?Q?CJ8ktRF6v1NVr5+j/zs/I1H1R8NnnxhERnZGQenA7ez00SkWbul2RdfV/u9S?= =?us-ascii?Q?kwsJvrip+NlT/hBm5JrIdJdG+3qUXy+is3cZxAyzXf15RZxAtYKVzm3ofyoJ?= =?us-ascii?Q?dt1tCadkI4oGXeIzGpSuLXgJjJbdD9rlZ/nhLy5B/AQ3oGW6CpFJaDvLVbFM?= =?us-ascii?Q?99GqEdkglGbpLfQY8vkdlhMaovWmR9zLMRO8ohKEc2ADeTeNUTfFioE69cQh?= =?us-ascii?Q?l6pBxKZDCu/3+2RY2xdnZZyBnWa3tSRk2eYRyc/RyolA7SG8yLfAl0I7Mp0Y?= =?us-ascii?Q?W/HZLA9jFvo+/PNfRv6AOUVMsFxYSkkoq70KXv0u5pWC0h+v858OSRImTNUO?= =?us-ascii?Q?6pY3g9pq4bGFqCYxNECCv2K9jc04YfYGo6BK7u8kmn7Cwl0IsdWtFfZaAK/C?= =?us-ascii?Q?A1zd83mvTVDTioLhV9Ke+VfA50uyULmT1igyXK1losFn7tpcUfjqOanwC1eR?= =?us-ascii?Q?iABPsttpUIinn/ceR8IaI0W4S13sV/TKRNxI7xz4ZHF2+nZiU82MeGyduZ4j?= =?us-ascii?Q?yvRkGp4dXFkM28h413DWzK6SEt5m5Q4IYxLu8PLSH4bE8uaqmR4mTQfgRCiJ?= =?us-ascii?Q?BhI5JVHbzxeZaPcRwq3C+0+0NW0KelKPF8B7aavj+UwW/kyFJpO79qgQjQNL?= =?us-ascii?Q?uYmgybUQo6GayGjmlaR+VheymaiyfWBQB5+SRQPIlsiF6EDpqx63/Atu+B/S?= =?us-ascii?Q?ZIY5em7D5yaq2G2t+UpkIBiB7otAq3/gNWiBa2XjjijZonefQ5bGktv8y3k0?= =?us-ascii?Q?iHFJLW0qR37jJImuk2FvtncrcjPhyheDxutlPjnHcySyDimuf6zxCJ+SK2Hl?= =?us-ascii?Q?OEOe4QP7YRFOylMtj8r45DBW0NPWRteyx4n4l5VoHt6LEDJwu1R7nwYvf52X?= =?us-ascii?Q?LikgkrY7IN0C8zv02aakqON+OY4MaNhP9d3wBjPJdUs+Kk1yL04J1pmGdh5L?= =?us-ascii?Q?Odg5Rjkk2OVvFCW5MXKdy1mByxY5X4Mnucz4pXCanX3dvLY1IyEzW4Ed1xLQ?= =?us-ascii?Q?ulDioKPp5dzvfqTLCvk8jNgbrmEcT+UuZkWm2kAE2FUMqfezcKvTwopA/AQE?= =?us-ascii?Q?BV5bbRBuPcoK2f1cxcKyHNmL?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3928 Original-Authentication-Results: networkplumber.org; dkim=none (message not signed) header.d=none; networkplumber.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 97c06316-551f-4c47-74cb-08d941f48769 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0BfMdAR3BcMZLAFwl9OlIbA8FQW8WCNJgaToRAJvfq30GR1DLr4Xv6P8upWKD9jNgKMfUpDfOAgRMdGsWTQWVPIXKV+YBQbwowSjtWGyxH8p2v2il6SYXD8vXd+bms5HNUnar3SYYY42MQBWmHDaH1yLflHEfWwrfN3Dm9h6rgmKPO9aFIYHPttvsAqShi37gx3iRcy0wrcwmspsOn5xwxzrrJhV/ekLmIadV+bG54reDU0Oq0cGvHS/8myJ4eoZQ3Om/DDGpfHTVOjG97lZg5fcZm5hMv/tgt9v4R/S0kdZie1ueiv6ulOVsEFEf0plbWeR4c7VNV7ljC6IY8eu5HQYRAvOqt8MtDdeR/SxJHOrWxLGrvATHWOCiAyIEcBRnaJNfdYYROi4cMqhbTG1d6l5mxyUnQFm4tPpBlUihcDJMd2xdDfYibeGud1bPoA+J0umsI1gN5VCOlkKdmpOq9UdO0Djirb1geIBSjNkzkr+E+qsaGFo9RX/IJZOeoGH1GikGV20MpoIzzeki1Olj6gxMh1Q3aAr2uaLHPRRduLdWwfK8D0yf9Dg1WVroXFAMODsOwviQ3u3+A0Co2rwpDQO/VQGxLtblDpkrUyLyei54RLhkuaK7z7paxPG78QUWf0TuEib1nSN2zLut5hPN46aGgkZglGUZ7pNEqEpgoaQj/pBIyYN2nfvnC9Fq9r4c15SEULVT/KmhR3Y8fq9rmjTc43Wmmn8wDXp1/if7Hz+se5LVx74qP9PGkGmKKG/g6jvxvlM7rOJ/Fg0GhPW4Fbn81cKKphhUL7MkPIWFEjWDlL/VYORO8F1zz6O9JGF 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)(376002)(346002)(39850400004)(396003)(136003)(46966006)(36840700001)(53546011)(966005)(33656002)(47076005)(54906003)(7696005)(6506007)(26005)(70586007)(82310400003)(8936002)(186003)(9686003)(478600001)(316002)(70206006)(86362001)(36860700001)(356005)(83380400001)(2906002)(336012)(6862004)(52536014)(8676002)(4326008)(82740400003)(81166007)(5660300002)(55016002)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2021 09:41:27.7242 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc6cc668-780c-497b-b7df-08d941f48f1b 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: VE1EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6567 Subject: Re: [dpdk-dev] Use WFE for spinlock and ring 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: Stephen Hemminger > Sent: Wednesday, July 7, 2021 10:48 PM > To: Ruifeng Wang > Cc: dev@dpdk.org; david.marchand@redhat.com; thomas@monjalon.net; > jerinj@marvell.com; nd ; Honnappa Nagarahalli > > Subject: Re: [dpdk-dev] Use WFE for spinlock and ring >=20 > On Sun, 25 Apr 2021 05:56:51 +0000 > Ruifeng Wang wrote: >=20 > > The rte_wait_until_equal_xxx APIs abstract the functionality of > > 'polling for a memory location to become equal to a given value'[1]. > > > > Use the API for the rte spinlock and ring implementations. > > With the wait until equal APIs being stable, changes will not impact AB= I. > > > > [1] http://patches.dpdk.org/cover/62703/ > > > > v3: > > Series rebased. (David) > > > > Gavin Hu (1): > > spinlock: use wfe to reduce contention on aarch64 > > > > Ruifeng Wang (1): > > ring: use wfe to wait for ring tail update on aarch64 > > > > lib/eal/include/generic/rte_spinlock.h | 4 ++-- > > lib/ring/rte_ring_c11_pvt.h | 4 ++-- > > lib/ring/rte_ring_generic_pvt.h | 3 +-- > > 3 files changed, 5 insertions(+), 6 deletions(-) > > >=20 > Other places that should use WFE: Thank you Stephen for looking into this. >=20 > rte_mcslock.h:rte_mcslock_lock() Existing API can be used in this one. > rte_mcslock_unlock:rte_mcslock_unlock() This one needs rte_wait_while_xxx variant. >=20 > rte_pflock.h:rte_pflock_lock() > rte_rwlock.h:rte_rwlock_read_lock() > rte_rwlock.h:rte_rwlock_write_lock() These occurrences have extra logic (AND, conditional branch, CAS) in the lo= op. I'm not sure generic API can be abstracted from these use cases. >=20 >=20 > You should also introduce rte_wait_while_XXX variants to handle some of > these cases. >=20