Re: [PATCH v2 01/20] locking/rt: Use raw_spin_lock_irqsave() in __rwbase_read_unlock()
From: Peter Zijlstra
Date: Fri May 29 2026 - 16:44:38 EST
On Fri, May 29, 2026 at 10:13:35PM +0200, Peter Zijlstra wrote:
> It is somewhat possible to do an RT aware read-write spinlock thing, but
> it is definitely non-trivial and this would be the only user.
Furthermore, it is fundamentally one of the worst possible lock types.
It really isn't something you *want* to have -- arguably even for !RT.
They scale like ass; per them being a spinlock type, the critical
sections must be short, but this means there is nothing to amortize the
cost of bouncing the shared lock around -- which is the 'saving' grace
of the rwsem.
For short sections the cost of the shared access will dominate. I'm sure
Paul has a bunch of graphs to illustrate this point :-)