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 D521EA0547; Thu, 11 Feb 2021 23:51:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59C4022A24E; Thu, 11 Feb 2021 23:51:44 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 5730740147 for ; Thu, 11 Feb 2021 23:51:42 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 6CBE75C00CA; Thu, 11 Feb 2021 17:51:40 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 11 Feb 2021 17:51:40 -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=fm3; bh= aHsmBI1CCit3kykjZW2hg7BXocuD5XqADkYQ9nrOFyA=; b=lEl38sxzJsdoizSW UNin1hbuJ2BLaPIe2KIdDjO6hK63+4puOO8o5aLHCPkJ5bvYpu0EeZScDgddtvRM +efHvo6LoTmm4qkJKL2FPVbFFhqJu7UU3sm/cqovHS419MF/jZh9t2n6fLEspQx6 rLqHcnqHjE3LPX+w0ECJHCwOy9f47OcdMw6Cj8jkTJMyb9OdR4FxdJPvE/X+En5v SxLkcw65Dt4x5DLkwYU0efEpvHS26Q2gGPpG8pj4++2FwHmkUsL1TNS/eCUFOlOq TLu05xSNunSPkoV5quVoZPRlSNzMPL8ftrUlKGalnldKn+uf9O0rIqozwRyEdrKf JBMUTw== 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=aHsmBI1CCit3kykjZW2hg7BXocuD5XqADkYQ9nrOF yA=; b=PLDiVAcp9wl8zrGKbuXQkbdPPl45Mx1zZBabGb+dlGRNDl2Ig/5jaxFzj tMZTKyfLYxXAkwxPlNZANv10bFm97pZBFLSPFDe4RSk6+af5kpnanGQeBhJGlwAE NgLjJZsz01wWQodaoEfS6b/899Xqd2sgfWzOhpn+abzsfL7dM0lLKORdUhEo4YTJ bmK+2CbEJlvT6jHuVRjDePci0WJ5Zq1SW3uLFckwvRGNz/P/lhoz2Z8EqbZ4uBMW IExCzxhkEHjwQLxrbS8EpWuGwBxU5fdV9oc1ByGPxQ0Tz5mYlxGfiNkfi1JblXX4 jolBRHCuDIMF7PeAp8u+fLthR/Q0w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledriedtgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth 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 id EDD8B1080066; Thu, 11 Feb 2021 17:51:38 -0500 (EST) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, joyce.kong@arm.com, konstantin.ananyev@intel.com Date: Thu, 11 Feb 2021 23:51:37 +0100 Message-ID: <6427760.fPJ3V7j96H@thomas> In-Reply-To: <20210114165556.31353-1-stephen@networkplumber.org> References: <20210112010453.260646-1-stephen@networkplumber.org> <20210114165556.31353-1-stephen@networkplumber.org> 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" 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 > + * 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. You did not get review, probably because nobody was Cc'ed. +Cc Honnappa, Joyce and Konstantin