DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Mukul Katiyar <mukul@versa-networks.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [RFC] Highly efficient reader-writer lock (EPRW) for mostly-read applications
Date: Tue, 8 Sep 2026 10:40:12 -0700	[thread overview]
Message-ID: <20260908104012.7489b055@phoenix.local> (raw)
In-Reply-To: <DS7PR11MB885556AF77C5110C85609B7B8CB22@DS7PR11MB8855.namprd11.prod.outlook.com>

On Tue, 8 Sep 2026 03:55:12 +0000
Mukul Katiyar <mukul@versa-networks.com> wrote:

> Hi all,
> 
> Sharing a userspace reader-writer lock that has been running in production in a DPDK-based network function for several years and wanted to check if there would be interest in contributing it to DPDK as rte_eprwlock.
> 
> The Enhanced Passive Reader-Writer (EPRW) lock eliminates atomic operations on the reader fast path, giving near-flat per-reader performance as core count grows. It is compatible with poll-mode lcore discipline — no heartbeat or periodic refresh required from registered threads.
> 
> Details, correctness proof, memory ordering analysis (x86-TSO and ARM), and performance evaluation against rte_rwlock and pthread_rwlock_t are in a preprint at:
> https://zenodo.org/records/22636501

Dead link.
I looked at the original article as found by web search.

> 
> Would this be a useful addition to DPDK?
> 
> Regards,
> Mukul Katiyar
> Versa Networks
> 

Send it as a patch. I have looked at lots of different reader-write lock implementations such
as phase-fair and mcs reader writer locks. The trade off is always cost of lock acquisition
when uncontended, versus behaviour under heavy contention. The current trivial version is fast
when uncontended; other algorithms add a queue (like mcs) which makes them behave better
when getting hammered by lots of contention.

DPDK was also fixed to not starve writers several releases ago. It seems the research
paper is referring to original old code.

Also using reader-write locks should always be discouraged. RCU is a much better solution.

  reply	other threads:[~2026-09-08 17:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  3:55 [RFC] Highly efficient reader-writer lock (EPRW) for mostly-read applications Mukul Katiyar
2026-09-08 17:40 ` Stephen Hemminger [this message]
2026-09-08 21:16   ` Mukul Katiyar
2026-09-08 17:55 ` Stephen Hemminger
2026-09-10  5:51   ` Mukul Katiyar

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=20260908104012.7489b055@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=mukul@versa-networks.com \
    /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