DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Joyce Kong <Joyce.Kong@arm.com>,
	"konstantin.ananyev@intel.com" <konstantin.ananyev@intel.com>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Subject: Re: [dpdk-dev] [PATCH v2] eal/rwlock: add note about writer starvation
Date: Wed, 12 May 2021 21:10:43 +0200	[thread overview]
Message-ID: <2082962.30Ae9O2n7M@thomas> (raw)
In-Reply-To: <DBAPR08MB5814224330DD6E75F964B6AE988B9@DBAPR08MB5814.eurprd08.prod.outlook.com>

Ping for v3

12/02/2021 01:21, Honnappa Nagarahalli:
> <snip>
> 
> > 
> > 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
>                                 ^^^^^^ 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





  reply	other threads:[~2021-05-12 19:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 19:13 [dpdk-dev] Reader-Writer lock starvation issues Stephen Hemminger
2021-01-08 21:27 ` Honnappa Nagarahalli
2021-01-11 11:52   ` Ferruh Yigit
2021-01-11 13:05     ` Honnappa Nagarahalli
2021-01-12  1:04 ` [dpdk-dev] [PATCH] eal/rwlock: add note about writer starvation Stephen Hemminger
2021-01-14 16:55   ` [dpdk-dev] [PATCH v2] " Stephen Hemminger
2021-02-11 22:51     ` Thomas Monjalon
2021-02-12  0:21       ` Honnappa Nagarahalli
2021-05-12 19:10         ` Thomas Monjalon [this message]
2021-11-08 10:18           ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2082962.30Ae9O2n7M@thomas \
    --to=thomas@monjalon.net \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Joyce.Kong@arm.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).