Re: [PATCH net-next 1/3] ppp: convert rlock to rwlock to improve RX concurrency

Qingfang Deng <[email protected]> Fri, 27 Jun 2025 17:23:47 +0800
Newsgroups org.kernel.vger.linux-ppp,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <CALW65jarGfgtkSJ3pdNTxgDpjzN-K_unqz3GWqH=BHdhmHKMug@mail.gmail.com>
On Fri, Jun 27, 2025 at 2:50 PM Eric Dumazet <[email protected]> wrote:
> tldr: network maintainers do not want rwlock back.
>
> If you really care about concurrency, do not use rwlock, because it is
> more expensive than a spinlock and very problematic.
>
> Instead use RCU for readers, and spinlock for the parts needing exclusion.
>
> Adding rwlock in network fast path is almost always a very bad choice.
>
> Take a look at commit 0daf07e527095e6 for gory details.

Thanks for the info, I'll see how to refactor it using RCU instead.