[RFC] Highly efficient reader-writer lock (EPRW) for mostly-read applications

Mukul Katiyar mukul at versa-networks.com
Tue Sep 8 23:16:11 CEST 2026


Hi all,

Apologies for the issue with the link to the latest version. Zenodo—a widely used European preprint repository—has been experiencing frequent downtime over the last few days.

Stephen, it looks like the web search turned up an older version. Here is the latest version, which addresses the gaps in the previous draft regarding weakly ordered memory architectures, adds performance comparisons, covers rollover/    broadcast mechanics, and details cache-line-aligned per-thread objects.:

https://drive.google.com/drive/folders/10vzzQYHB2Z6KKIWyqI2fDxiss1jTA8QM?usp=sharing

I will reply separately regarding the design choices and their practical utility.

Thanks,
Mukul

From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tuesday, September 8, 2026 at 10:40 AM
To: Mukul Katiyar <mukul at versa-networks.com>
Cc: dev at dpdk.org <dev at dpdk.org>
Subject: Re: [RFC] Highly efficient reader-writer lock (EPRW) for mostly-read applications

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


On Tue, 8 Sep 2026 03:55:12 +0000
Mukul Katiyar <mukul at 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<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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20260908/b1cded1a/attachment.htm>


More information about the dev mailing list