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 4EBEDA0C4B; Mon, 8 Nov 2021 11:18:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 127AF40DF7; Mon, 8 Nov 2021 11:18:49 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id B9A3240040 for ; Mon, 8 Nov 2021 11:18:47 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1C8E55C003E; Mon, 8 Nov 2021 05:18:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 08 Nov 2021 05:18:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= DJyxXY29+hkFKP8WIO5etp0j+IAYp4EbVmcrwUP8Gq8=; b=bVUJ+JdFmjRDsAlY IbMGIQwxrB2dXrL4glwS7v4m+4+smxbbaaORVIAJ/+32axIWrNvKoGXt+Ii/xNzJ Car/YCPS+CGtoVdus/JwZghVCNN07VpeW4y2cfs4RObaoeW84kqVU9oCr+X7rRzS zcJicLza7Fj/AwqSrCnZ9EYWJkLXxyysYfl2kof8niDDE37TiVPI+E7yBGQ5uKj/ kSTIIHSQ9oMiHBRlKQBuWe/7HtNU0dqljZVhbBBcXdlC3GnmQrB+nGbtSpK3ZrHE myVifqzq0joyVY5g0jmyVtffhHc5531XuYozyEdSkkVO7w8ZfbhWxXmlsH4SBhrk 5LZn8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=DJyxXY29+hkFKP8WIO5etp0j+IAYp4EbVmcrwUP8G q8=; b=QFvwPIcG16q32Uq1sb69S8cjF4QG0E25nCesaYJSQ28/k4AYU+BfzEAKt TEnhnoW/tPVxzeqPd7szgLD79E5nydkRnAfm2MrEz3n0DrDI/zFVSF5/KmExkGjH hcgSkKa/jrDVXpRQ6c0MxuO8jptf+BrWBhjlBWq8cLUTokJ1TRANmKC45m2J1owf UjMMqkVRCz4A4nmLXwJVQvuFmk6RYuOyCgPQNw4UnpMz6zGMcl3Yt8y6q9HRN4Yt zN3yQ8MYJfATygCMsIY3mB9yW/FKjvvytJUWzgp7RLH3RaQ0sgqAzD0kIjcxrRMU G0vVvKcLn9JxWDK3OGsn8aDK8XACg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddvgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Nov 2021 05:18:45 -0500 (EST) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org, Joyce Kong , "konstantin.ananyev@intel.com" , Honnappa Nagarahalli Date: Mon, 08 Nov 2021 11:18:44 +0100 Message-ID: <5723642.WYoNDNk2nn@thomas> In-Reply-To: <2082962.30Ae9O2n7M@thomas> References: <20210112010453.260646-1-stephen@networkplumber.org> <2082962.30Ae9O2n7M@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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" Ping again. Stephen? 12/05/2021 21:10, Thomas Monjalon: > Ping for v3 > > 12/02/2021 01:21, Honnappa Nagarahalli: > > > > > > > > > > 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. > > > > > > typo: "are expect" > > > > > > > The wikipedia page on reader-writer problem has a similar example > > > > which summarizes the problem pretty well. > > > > > > Maybe add the URL in the commit message? > > > > > > > > > > > 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 better? > > > > > > + * 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 starvation is possible if there is a stream of writers when a writer holds the lock. Should we call this out too? > > > > > > > > You did not get review, probably because nobody was Cc'ed. > > > +Cc Honnappa, Joyce and Konstantin