From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <dev-bounces@dpdk.org> 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 <dev@dpdk.org>; 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: <xms:-7QlYOA1CAOKyj-RsEH0pxIXoB8gBzW3GUqv6rWfkIrwV3uc_qvAlA> <xme:-7QlYIhMXN3mf6QKeKaFJxDC5tLOBy95zeMFm-cDh_WukLQPAocq9bxtDIZKGAmPM 8jPhm1rPoU_1HUIdg> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledriedtgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: <xmx:-7QlYBkez6H0GbUlZHyTYqO96s2QDZ1pBD0ggHYd6-PbQhwuy1GjEg> <xmx:-7QlYMyyKaxFEFZLtI3h8UFdUPyAprs49WSyYBD02qKQst_21ruxOw> <xmx:-7QlYDQtuLyXcMD-37_FfX2F7N6Zs7nYIqotvrufEj0wNFWsh81vDA> <xmx:_LQlYOcsIElnmR_R2cM8VBsSyiwDaJVQpWeeaKeugLwkp1ZDfJq_hg> 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 <thomas@monjalon.net> To: Stephen Hemminger <stephen@networkplumber.org> 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> 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 <stephen@networkplumber.org> > --- > --- 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