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 AE41EA0C48; Thu, 8 Jul 2021 18:58:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96F6C40696; Thu, 8 Jul 2021 18:58:15 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2042.outbound.protection.outlook.com [40.107.22.42]) by mails.dpdk.org (Postfix) with ESMTP id DC1804014F for ; Thu, 8 Jul 2021 18:58:13 +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=AnJ/+Xi8s9B/kI4r4/6LsR0hca8GlR5VKoSXERNOtMQ=; b=Dgxy+k0y5jeDBiJO1q77Urd3gmNMQ/Stnu055/MeZ6cBdL0Sq7iUZwS5hHd8mT4+JuYTn8Smd6h8AJutRe3aUmZfLakOEcMu87GQQF7iMJ+PpfehZmmclB3uXzysMiL9qlMepEcVK1A+jQXSyjqfW/zLhYrCI/DP7ahemLU463o= Received: from DB8PR04CA0008.eurprd04.prod.outlook.com (2603:10a6:10:110::18) by PAXPR08MB6559.eurprd08.prod.outlook.com (2603:10a6:102:df::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.26; Thu, 8 Jul 2021 16:58:12 +0000 Received: from DB5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:110:cafe::cf) by DB8PR04CA0008.outlook.office365.com (2603:10a6:10:110::18) 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 16:58:12 +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 DB5EUR03FT040.mail.protection.outlook.com (10.152.20.243) 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 16:58:12 +0000 Received: ("Tessian outbound 770f4ae52989:v98"); Thu, 08 Jul 2021 16:58:12 +0000 X-CR-MTA-TID: 64aa7808 Received: from 4ba13333375c.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 84C8B1F0-7670-4071-AAD5-5BC860E976D9.1; Thu, 08 Jul 2021 16:58:06 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4ba13333375c.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 08 Jul 2021 16:58:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=azusfOTBzq45r+qts71UV9m2Czkpqa+752kvZCOohuCbF2jna7N7JIAqavYyaypa7INgG7Zya9mbprj2dy/H6VGhPUqut//VFRM6fDoG7MRU1ScmUF9EEc2E5dkxpva8DLZ8tgqiG4zAZzGtN1mnNNBy01SUO9xHSxlSkDycDAwutOGiuXCRcFPmVCj9N1QlKzeba6VSUearmyupZeruO3HeobaD2/pD6WoqberG2MxY4Y4XcW5I0dj1p295IcAof+sL/DihqzOjCn8HIrYnf0c7odKzV1SbqDnB5ZdJA1fYpYN9A8psSb3s+eQiBLTfOkF3jGMmdmqVJOYQ0Xg04A== 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=AnJ/+Xi8s9B/kI4r4/6LsR0hca8GlR5VKoSXERNOtMQ=; b=nSukGtprZaNqcXbye/cZhi69+qAqpisvdm/TbaVJWChVkX6zDi36GD61g7iYylh+aF1b19gjYzkHlxyns1i62V/5Rj5jy3pnnrdZiomFFXJ10bzsGtr21mgDc0J/DH3dhO0uxtVUCAjMsc6b0wLlhe8UqYvCExgtoNN97DthSDJUDqegBwH9toyzdulCw5r0etnuf1z7h0A1bnjReZRgg6lmXKEtNDGptjxqTQJNuXz1UCKP96MkDD9MQTyj+YGS5ZJpjdxx/zvIFTfH0F5vTTp/IiXzy3U1NszNLMPk0ZS97LJJs4lzEk2e1N+VJXzsXOhyW2qK+OzgMWXUSWV5lA== 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=AnJ/+Xi8s9B/kI4r4/6LsR0hca8GlR5VKoSXERNOtMQ=; b=Dgxy+k0y5jeDBiJO1q77Urd3gmNMQ/Stnu055/MeZ6cBdL0Sq7iUZwS5hHd8mT4+JuYTn8Smd6h8AJutRe3aUmZfLakOEcMu87GQQF7iMJ+PpfehZmmclB3uXzysMiL9qlMepEcVK1A+jQXSyjqfW/zLhYrCI/DP7ahemLU463o= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB9PR08MB6892.eurprd08.prod.outlook.com (2603:10a6:10:2a7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Thu, 8 Jul 2021 16:58:04 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f15f:821c:74c5:2482]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f15f:821c:74c5:2482%2]) with mapi id 15.20.4308.022; Thu, 8 Jul 2021 16:58:04 +0000 From: Honnappa Nagarahalli To: Ruifeng Wang , 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+AgAE3T5CAAH4CcA== Date: Thu, 8 Jul 2021 16:58:04 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 85750DA9AEC90748839BFA0D8351C2F2.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-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: e3429411-1b68-40b1-819e-08d94231925a x-ms-traffictypediagnostic: DB9PR08MB6892:|PAXPR08MB6559: 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: hQfDCkZi4s30Dgqj2CRZxQSgX95FRymkALu9x50VH5qQQo/Fw7t/PwRgPI+7QdHSSHpBYZYgtNXBT7oD7bHwk0QJ9U7epEVgrRAmoHGshDg9TsmvMqn6cui8AMOftGeN2dRle/ev3py4nCKzV4BefmlaedeZ0NeR74nyR3ZicHjtGOcePAG8AzI4PguNvvTjkc+B7rqwU+D4we5HzEvN+k9z4qdJXgNREiNKk8KvtQgBqjugweSAAks9ZkQDmQQk49npu+ZOAXyDsuw1P3Ao6+w2m5IcBd88CGtOVRyDIaqeRusVnyUdqGFIN5sZfLvQUyKRXfi1N3DOl/oEqVqTHHujY2bs9mZ9CxlJZ9VO2HhBFIMWaVmHsA1T3WV6OZKVnw7D+9E/rKcIRCu81bIRCCv5o+PKycfRagX4m72WBDFPS2L5+UfwkbzEFCMpUZokx5Dv13IKGIBNvTrVALiJBj+jxsvdXdCC+cZ40D/5mxCEOjNJD5SixvAfgtcveO/KJyvoBAjR/7Wq1uPXYizmm125HQIhfMQDEOJwbgkt9zT5jiZTw7+OWs5Xng5eAbEK2Cye986SUAgKTRwYUceSxRj5/WZAVSMFJbi14DcGnl4L++qtB5Wb+ZQ+OP4kmWvDBYBR4DP+fL4maNNzBMgjXvQtKioNVbOLc0UGU1cJmTsADP4Ib5BaH8/63xFMHYAHomM4Ax8bfANCH2runytNeBugtT3FZ79UfMecjIg+vEAe6jCLDaCMeYuvYG63WUvy214/nZs5KCGKI7CP392PxqX2g+b1fTphq3TTAOkAlH8= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(7696005)(9686003)(2906002)(26005)(52536014)(966005)(33656002)(86362001)(71200400001)(8676002)(6506007)(186003)(76116006)(54906003)(8936002)(4326008)(122000001)(66946007)(66446008)(66556008)(83380400001)(110136005)(498600001)(55016002)(66476007)(64756008)(5660300002)(38100700002)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XafBg3eASwn1bMoSNtKpH5T3d+GwMHEB90rxhfKd5zgK+4kaZ09R3BDuB0Lk?= =?us-ascii?Q?ZEjwh6oEdVEXtlkASpJ+eew/DCVESbGe4kMFet1Byfn8t7Uj+UsJ6xKOguSS?= =?us-ascii?Q?JczSZELRJYF6g5SBr+xFm9Jqs3GlapZQLD3FvR50P0NXnM64G2lKUqaatFMP?= =?us-ascii?Q?pgZebEogO9nQI8kswpLjfKvwA87qp+hVbVj/4Dfa9U+1vnEjH3z48/Gtjzds?= =?us-ascii?Q?bMrsenpmZW1qNVPY4V02n6Ls0uk+KgmiFnWL6VpGLyIs/TZiV39Cant7B8iE?= =?us-ascii?Q?XggyqSBfuLlLuIdaLzIXc0PwFnnMHAoe7iMmvasY/quXStW7NDGux1XYsioC?= =?us-ascii?Q?mYLbV0Y1rFukEl88ZFzTd2P4ExKKFvFG+pUMFKjMrQboVBK0boCdPqGvJ3Pg?= =?us-ascii?Q?OXRS5jHOMnCewlSz4CqideO3QfqmAU/FNahOWx5hGbRWHRd4DP4zj5V5aXRz?= =?us-ascii?Q?j8rp5kycpEV79o82tYlhQjOT1+ZteKcgL2UKDEUqn3632KNRZGMbTPfgPbJr?= =?us-ascii?Q?F2zPYkg6pMLOHK5pGf3fgDg9szLsfVwtllaSGzmeFN8n5qpYdlqMxM9lNK0i?= =?us-ascii?Q?6ZCq9vWL2gGS5JoZA4gbpecdTzge0xqrHaKLt3zg5p/0cVekalxQiG7kecUg?= =?us-ascii?Q?Kro6yub7RPjZlBzjLp8FhqNPTN6vWIe6tLIFIxV9Yt/7xbDD/K4pZV+EOwjV?= =?us-ascii?Q?PkDs+vSXzQ+r58f0sOpq+EEVBVmyIeWLa5StN35ufomNM48+deo39/Z6BIRv?= =?us-ascii?Q?aaj30A32vfUhoexdOYMdKZfnRGFx0gaVPDTXTnP5Qtqy1NyXRCjOKrXeyWUj?= =?us-ascii?Q?GtFLA12N5LFkStrs3HrsDFlDZiADrvfZnICyY3+6gt9O2bdArka0wfkws2ng?= =?us-ascii?Q?8z0cehLHm16R34L5dTIPXLL/oSDciLJHFXv5Zd03zJ3M/gGtXF/lpveIVL9A?= =?us-ascii?Q?X9cjwRCujfMXq/KTPkM0gMBZPN8oMvx2+morT6Qh6cPdZt7DjwMR9Qh8PhbH?= =?us-ascii?Q?rkyxqDf1svCIHu7GMOTW6q4Pa4U3KArF38jXViRwbdT981cznqWr607QcDlu?= =?us-ascii?Q?bZwYnd7pFiwmyuG+ueO84nZ82bMsJ1QIGs4NBneTn48h3Yu5R15VacKeFySN?= =?us-ascii?Q?un37owg3tOkGhGRGiH/uJBQgL+vQztxXxTWwfry7XZzyD/VDqbUhe7SnZaPS?= =?us-ascii?Q?+MSHA/Sbg0K8vPLg+mD/gYcnx+hot3yXh5cOKlPQF0bsfuzO8WTtJbS4Sp3c?= =?us-ascii?Q?4K1vtRS2ophLP+TCaWCQ0/dKq7tLegDvaBR2C6yQ5vV/5lPwOCD6WhwP8kZ5?= =?us-ascii?Q?dlzqyz0HkjWbBiylsTU+mlUU?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6892 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: DB5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e921d02f-7c9b-4a53-4fc3-08d942318db6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IbdeK86/YEn/SSDUWY3kVXwkU20/J+CIBXMel408C2NQ06BdjaujlJvwfqaW0IQ+NFbPZwHz3aQC76KQyG9LUfzRs1s1Flx2K2aizWOcEC/G0WqVL3/wEnv4LyWjIrpUy/c6nD8/G0zGXr6X5esKfi8WfYSUOllcMTSpYC9W/ex3Jp93fHJCh6kIR/zMRKiaN4JPmApJKMMzZCvKa8v5uWA7uRSQUveOfDbAhRwKaPYg4eyNlsug9/diF6LCm26l2fI2qH+Ow2siRjkvRSWqUt/J+AUrpbTLvy0LKxV/zBbgP0+77NljLjWlGKdIlApy7N8KEDQQifr9J+lmYQ00pqxefFICn4UPs78aqEn85xZO2xI/zrHw4HZM1Q3PXN4dlbA/y5IXXDWP7o4Ryt9jssdwc4uYl73qcqnAx2Frh0tQ/tC/tnq9v/X5oYZ8DqoaQuwhloogTNaXhnhs+CIC4lX5ul91JRVEyFxjL944thH1ye+/1XApeCa/aLkb/3LKJEPVblb+JsPAffuFA8K1WbHuZJenuzKvSs9sCu/KtxQ7xrwCVvOeeKmEx3YVMTaDZPsbch1KCDF2FOeDM5gShLb7lQm9CTwpxV42lgfrRxwJkj0fRXksVD9cGJacvlpqAp/GQ2ZqEDI9jW8qvLM0yiPlVjyzV4WIZlOOFSLWrulR/IfVR5/KJ93Vux6rISACon9FxM8Lt7k1GfIQE3Dyi3BoIhOKok5dLpbfSU6TbdlQ/erlbsOtZwFX5RPkQHGeKQXbj/azORDhW9a3nDtl5/4mHdx6c9Y7Fffy8FBIKUHwIYuLG/IB9R1soAyKB4Fd 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)(376002)(136003)(396003)(36840700001)(46966006)(82310400003)(81166007)(186003)(52536014)(33656002)(2906002)(70586007)(6506007)(8936002)(5660300002)(26005)(7696005)(356005)(336012)(86362001)(316002)(4326008)(83380400001)(36860700001)(966005)(55016002)(478600001)(47076005)(70206006)(9686003)(8676002)(110136005)(82740400003)(54906003)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2021 16:58:12.5811 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3429411-1b68-40b1-819e-08d94231925a 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: DB5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6559 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" > > > > On Sun, 25 Apr 2021 05:56:51 +0000 > > Ruifeng Wang wrote: > > > > > 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 = ABI. > > > > > > [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(-) > > > > > > > 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. >=20 > > 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 = loop. > I'm not sure generic API can be abstracted from these use cases. I think it is possible to create additional abstractions to address these c= ases. >=20 > > > > > > You should also introduce rte_wait_while_XXX variants to handle some > > of these cases. > > >=20 >=20