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 8AB78A0C41; Wed, 12 May 2021 21:10:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22C484003F; Wed, 12 May 2021 21:10:49 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id ED56C4003E for ; Wed, 12 May 2021 21:10:47 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 702965C0116; Wed, 12 May 2021 15:10:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 12 May 2021 15:10:47 -0400 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=fm1; bh= kBleGeuDLXCDtoCtt4+9fOIKKjXCXOuTv4kshdHByoQ=; b=4jcczrNdIPsGFvxq N/JHwMl7xRD/nSdsVyQZRpQZjsvy9IvrnvCRqfAscOAHvY6ahlPUmZvWJa4EX/WH xbp/18HcMEPuon5q7gbXgslYR7+l1COvGigP3TjaPw+vIbkQIjYyVPlSrMqEFa1I Hs1siKcRS3SVw8SceGPWEiyP+dpX3te+soFWwN9dGkJKj00viV7HQvOg+ua4pgrO pO2gE5Or6Pdr3+/2ga5M2W4lGNeq6NEqwmtq9BLQbQ55MuqmIlvtbsup2CAGXS9A JiJNJD7kxlxS/pz5QNHjQPhmgCnz2CdFKP1qZ6wLTX7lR7NadUCE1yqQXSe4tepd 4SE4Hw== 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=fm2; bh=kBleGeuDLXCDtoCtt4+9fOIKKjXCXOuTv4kshdHBy oQ=; b=DoSMe/BjKGu1ZFDz+Lg2lurQlqfaSkO6lYXdTjxBxi9EAK79Wy4JzLnkN k9/94goxm68HlmMPLL2ZLeRP5O3uTKcMDFMGArLsEice5DTo8/YWzCd0D22Vtq+O f4eXO3eDQBek1TXfwepMrcklpz2jg08WMQQOJWN5lZOdAjRr1GWhzsL+hvLM06+/ 3V8BJHXjy3kN442Irk2n+VCZrNi7bwBHx/9VYGRb3bdrlfJPO15zh8iFg/WQxyJC YlD0QDcIMdasiSEZPQnXitlMgTyvcpQDw2akC/qoEcOVN4PGGI5KNmDE+De1/ql6 8ETGEEzKeCt+YLB7YTaSUtt28ws+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehvddgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 May 2021 15:10:45 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org, Joyce Kong , "konstantin.ananyev@intel.com" , Honnappa Nagarahalli Date: Wed, 12 May 2021 21:10:43 +0200 Message-ID: <2082962.30Ae9O2n7M@thomas> In-Reply-To: References: <20210112010453.260646-1-stephen@networkplumber.org> <6427760.fPJ3V7j96H@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 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