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 C2916A0547; Fri, 12 Feb 2021 01:21:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 533DE22A283; Fri, 12 Feb 2021 01:21:36 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2087.outbound.protection.outlook.com [40.107.21.87]) by mails.dpdk.org (Postfix) with ESMTP id 6240422A1FF for ; Fri, 12 Feb 2021 01:21:35 +0100 (CET) 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=ggmVH7ordAXoVfL0u9uqbI7elY9FA8VqJmVc+/0d7m8=; b=cpBJJ8mlIIet9MyusvBgPstISwG5tTZRZlwbxNueREy/HawBPfw/ucQu8NKIkF4hY97ndReLEwMsnU4pL+J5p7bZnrRJrthDYUlZAvyzNfH+5FSUmeZqvIkhqxe0jYE9u8zDs7XNsWI2iBL9QsOKpebCsH0MVj4Rb5FMgrKZoKw= Received: from AM6PR08CA0010.eurprd08.prod.outlook.com (2603:10a6:20b:b2::22) by DB8PR08MB3945.eurprd08.prod.outlook.com (2603:10a6:10:a3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.17; Fri, 12 Feb 2021 00:21:33 +0000 Received: from VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::52) by AM6PR08CA0010.outlook.office365.com (2603:10a6:20b:b2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Fri, 12 Feb 2021 00:21:33 +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 VE1EUR03FT015.mail.protection.outlook.com (10.152.18.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Fri, 12 Feb 2021 00:21:33 +0000 Received: ("Tessian outbound 4d8113405d55:v71"); Fri, 12 Feb 2021 00:21:33 +0000 X-CR-MTA-TID: 64aa7808 Received: from cc13f54fbfee.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6BB057F4-A538-4A36-B9F5-1888132FA17D.1; Fri, 12 Feb 2021 00:21:28 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cc13f54fbfee.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Feb 2021 00:21:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WyHcbuFuWtz8aDqVhFSTqwrG5ZFPB9EVzjh4gTwy6iQja+3e6Je90JLmKdWsan74NQMzG34MEjKBdb0zt489ohaYntqIvmvlNHgL7VR8ZR7kM6vykVe7Iv7IEdzrtW6umz/p0a8DdfE9lPbNrsF7RZeJ5KQI1rkjiy3IEncnetpDVJ3VzxuivCU+JIGpECyZq6ilB9H2PoVWSbktHCEtZRDwMl4qdeOjPmg4IUT0ixTTOL36X8jeWjZiGJqpc1N7O0KuQkrXMYxbzf9MMSLBS0iYcENw3N6kmDjB9x0ggZpjrYRVPHTRqq9NR/sLTc58+xmUtHQS0sOaJPaBNrGIbA== 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=ggmVH7ordAXoVfL0u9uqbI7elY9FA8VqJmVc+/0d7m8=; b=jq7Yc5K6XhXehMYMek7PfxcSv4hCULp6c9QpVdbZS93CoWXUYD4IcccSCsA9KZYtYsAbcrONcvLQjabJQgluG9IotehSYC/OptxPDt4GSezKG1zXfamoQCKK9tCWvc0PmQy1EeDhRw4K4JtVIDG1px/2PHtPcaEXFU+BVtGgqmznQcC6peg8AInzMfb7BeRbNiS06pqEW3nfANV6nMnlbK/vetxWTFgXwcLAQ3eXiHGquxnStnufwGF0DmcI6kSMLx9GFSwSAUp+Ouwa2SciYTg/mZA4uAArFq9cxqT9M5Hs8lX1bHM+3ViJhzOLPNNHXAcH0wP/9GwOCZcLvxe1WA== 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=ggmVH7ordAXoVfL0u9uqbI7elY9FA8VqJmVc+/0d7m8=; b=cpBJJ8mlIIet9MyusvBgPstISwG5tTZRZlwbxNueREy/HawBPfw/ucQu8NKIkF4hY97ndReLEwMsnU4pL+J5p7bZnrRJrthDYUlZAvyzNfH+5FSUmeZqvIkhqxe0jYE9u8zDs7XNsWI2iBL9QsOKpebCsH0MVj4Rb5FMgrKZoKw= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DBBPR08MB6170.eurprd08.prod.outlook.com (2603:10a6:10:200::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.31; Fri, 12 Feb 2021 00:21:26 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::cbb:4373:1761:19b1]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::cbb:4373:1761:19b1%7]) with mapi id 15.20.3846.027; Fri, 12 Feb 2021 00:21:19 +0000 From: Honnappa Nagarahalli To: "thomas@monjalon.net" , Stephen Hemminger CC: "dev@dpdk.org" , Joyce Kong , "konstantin.ananyev@intel.com" , nd , Honnappa Nagarahalli , nd Thread-Topic: [dpdk-dev] [PATCH v2] eal/rwlock: add note about writer starvation Thread-Index: AQHXAMiNzkRxm+95TUa9vtbiKjzfCqpTpx0A Date: Fri, 12 Feb 2021 00:21:19 +0000 Message-ID: References: <20210112010453.260646-1-stephen@networkplumber.org> <20210114165556.31353-1-stephen@networkplumber.org> <6427760.fPJ3V7j96H@thomas> In-Reply-To: <6427760.fPJ3V7j96H@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: A5AAFE2CC51966409CF48C4F5691F09E.0 x-checkrecipientchecked: true Authentication-Results-Original: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.113.13.105] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 23121527-bff5-4280-aed1-08d8ceec2713 x-ms-traffictypediagnostic: DBBPR08MB6170:|DB8PR08MB3945: 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: p7Lx70SfNeJ1t6dGJHySSaw/VimKdctsMqlW1DUPvGm2Lxp4ukUB+U+rEvGoWsrgk+1SeP+Eg4uwdEx3g4a5Bm4Dj/HC3Gg+F/axXRrcwfMshpIUZ2O0tg82EJ4CmOp0fn6Pf3h2PA8qTUHvltAp2cf3Mp9h92RE5rOM0GVr+1LtTnTKx3FX9ZRRfI8t6NCjGvzNWzeCXmbWRXaE9wTs3Mv6DkoPb9v7kcYgdmjq90N0EusILtfaJ/bbjAmZKVyaDaZIuK0JkDlpiIgfOSRMBa4GigurwwnvPlu8oUpWfzY28lMfDmx2+W4Lni6kUl6BjAcI/8aT9Zk5v6J2T/34y14mjELC3LYTQBN6ZQaN4L7/Z9c7Hl9LWL97/FRyVZEnnmjKHO4GmEKyB1UY0PsNtCEodTeVaC4ibRI/1Wjcjda3F/9Wbvmgaj7ikdofL12UEdKku10AKa1tKiWUPTrvEJT/OVaDJoKIawMxNTEcaDQ60PRGkzC11wPLfIWm3JPe9lGM2I45YHLIGNP71BUu5g== 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)(39860400002)(136003)(346002)(396003)(376002)(366004)(2906002)(186003)(110136005)(66476007)(66556008)(6506007)(52536014)(76116006)(26005)(9686003)(71200400001)(55016002)(4326008)(8936002)(316002)(66946007)(8676002)(66446008)(64756008)(54906003)(86362001)(478600001)(5660300002)(33656002)(83380400001)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?TIozyxU8JMjc2qkrBzH2XRSQvTqq8uayVz2eGZXWAI0D7d+aIGGKAbchD3nT?= =?us-ascii?Q?/c30HajT9A7aJOoxvQUcCj3K7n+5aJ9+aeYWSxXUJESeLD2BnowGZ+w1QM71?= =?us-ascii?Q?FHMMLkTtvE1Op00D1PrOu9y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?Q?M/FAnWCFvk0LIwVbvhRyXeivye6xqbwNuP3xdtRXOJRdyQNsANBMIVkErDfL?= =?us-ascii?Q?FxbsJYq3lCgAQ7Oph2fYz6P1bEbz88NZlIVreJdeGm1BHw4lcTMp+A/t4ey6?= =?us-ascii?Q?bXVEiKn3Z2AnIwKqCm8kXXhUD9eHCKqdDpQi8y2NSLfgKyDHaCC1z8X32YUU?= =?us-ascii?Q?53FH19hvAKpArU0rzIrGIcxTEuC49/bTS+j3Ux73mh7xkzB5wK7JB+m5K6rb?= =?us-ascii?Q?qMVngB3LcxbFqvVq2vTK0P8Lxwep5XfuigQzpJJjJpYzxlpPnesq/Dks/uH0?= =?us-ascii?Q?gWiJKbGMeWzERxNgzhBMpvy0?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6170 Original-Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 426fa777-a839-48a6-c85d-08d8ceec1eb1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HHD2ZBdOhGhAHknJVeJJsj8HCpTZ6cXcDUSHZi+tVLVieazLit+6aR/DoB9syCnbHGi/FFbdqs4Z5JrRmlo9C9QxpypSKBOevL5CpiLnt8qIfjTMjZW7ohz4gx6YHxHFvJH2I6B7HUSEcz4eZxrEwnI4UkFl9oG1uX0tDL5J/4VPyOuoj3j7uKqj2seaXOY3rWPpWHs0633CZul3VJD5IsJMtTTEAJibf29Z/EeK35Wc4SaeNFmgQm99xFDRPJ55fjgyUxUBaXW7iFrFm3t9AcIdU2yTJ0QS72aEfP7LHyYcmlr/Vf0Y59E8YFciiU+GVn1xpdv0HUfL4bQTLNVDRN8gwZ3uN4HHLSF9eJ4fj39acBMARb2Bik6uPE1Rl03HKDx5d34N508cMgDB1LmVDRCL7t75vxczci6116GFq4DRf6fHfTz7+24cbdB79Tc+Gz+C3UyTUzCep1r4j4O8K5bLdWRivPntLfYCBuhY8ohZcejs375WABiE05BE8BhtuI49z6LhNMiWcvBG6/7CsWlKprNj9LmrBL3Kc1p67VmYV/28HEu+EURAQA7v3hAFt5uoVNu5RX5ejkbkQREpe+HBiYXet4VPm4dY10rkfPcbHR1nFlhg1J110qLa39Zkrf+ltXr3OnOEKkcV0pFXbGENRTB+UNXj2jKNXZlseT8= 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)(136003)(396003)(39850400004)(376002)(346002)(36840700001)(46966006)(86362001)(478600001)(7696005)(186003)(26005)(5660300002)(82310400003)(81166007)(36860700001)(8936002)(316002)(9686003)(55016002)(110136005)(336012)(70586007)(52536014)(47076005)(6506007)(4326008)(8676002)(2906002)(70206006)(33656002)(82740400003)(356005)(54906003)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2021 00:21:33.4740 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23121527-bff5-4280-aed1-08d8ceec2713 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: VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB3945 Subject: Re: [dpdk-dev] [PATCH v2] eal/rwlock: add note about writer starvation 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" >=20 > 14/01/2021 17:55, Stephen Hemminger: > > The implementation of reader/writer locks in DPDK (from first release) > > is simple and fast. But it can lead to writer starvation issues. > > > > It is not easy to fix this without changing ABI and potentially > > breaking customer applications that are expect the unfair behavior. >=20 > typo: "are expect" >=20 > > The wikipedia page on reader-writer problem has a similar example > > which summarizes the problem pretty well. >=20 > Maybe add the URL in the commit message? >=20 > > > > Signed-off-by: Stephen Hemminger > > --- > > --- a/lib/librte_eal/include/generic/rte_rwlock.h > > +++ b/lib/librte_eal/include/generic/rte_rwlock.h > > + * Note: This version of reader/writer locks is not fair because ^^^^^^ may be "implementation" would be bet= ter? > > + * readers do not block for pending writers. A stream of readers can > > + * subsequently lock out all potential writers and starve them. > > + * This is because after the first reader locks the resource, > > + * no writer can lock it. The writer will only be able to get the > > + lock > > + * when it will only be released by the last reader. This looks good. Though the writer starvation is prominent, the reader star= vation is possible if there is a stream of writers when a writer holds the = lock. Should we call this out too? >=20 > You did not get review, probably because nobody was Cc'ed. > +Cc Honnappa, Joyce and Konstantin >=20