On Tue, 8 Sep 2026 03:55:12 +0000 Mukul Katiyar <[email protected]> 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.

