Re: [RFC PATCH v2 0/6] rwsem: priority boost for holders blocking high-priority waiters
From: Peng Huang
Date: Wed Dec 02 2026 - 12:49:18 EST
On Wed, Dec 02, 2026 at 07:39:16PM +0300, Kayra Cizmeci wrote:
> Can't we select one of the readers as the owner?
I thought about that too, and ran into two things:
With a single reader slot, overlapping readers slip through: if reader A
takes the slot and reader B enters while it's taken, once A unlocks B is
still blocking the writer with no owner recorded. We'd also need extra
sync in up_read() so the owner task can't exit under PE.
Keeping a full reader list on the rwsem lets us hand off to the next
reader, but puts lock/list contention on every down_read()/up_read().
Happy to hear if you have a cleaner way around that!
Thanks,
Peng