On 4/27/22 12:31 PM, Waiman Long wrote:
With commit d257cc8cb8d5 ("locking/rwsem: Make handoff bit handling more
consistent"), the writer that sets the handoff bit can be interrupted
out without clearing the bit if the wait queue isn't empty. This disables
reader and writer optimistic lock spinning and stealing.
Now if a non-first writer in the queue is somehow woken up or first
entering the waiting loop, it can't acquire the lock. This is not
the case before that commit as the writer that set the handoff bit
will clear it when exiting out via the out_nolock path. This is less
efficient as the busy rwsem stays in an unlock state for a longer time.
This patch allows a non-first writer to ignore the handoff bit if it
is not originally set or initiated by the first waiter.
Fixes: d257cc8cb8d5 ("locking/rwsem: Make handoff bit handling more consistent")
Hi Waiman,
1. You likely need :
Cc: <stable@xxxxxxxxxxxxxxx>
Since d257cc8cb8d5 has been migrated to other LTS threads (5.15.y for sure) .
Right. The patch was created to fix a problem reported by another user. So reverting it may not the right move.
2. I had posted this earlier:
[PATCH 5.15 1/1] Revert "locking/rwsem: Make handoff bit handling more consistent"
That is likely not needed now.
3. Please add :
Reported-by: Jorge Lopez <jorge.jo.lopez@xxxxxxxxxx>
We can likely test this, but I can't give a ETA when that will happen.
Signed-off-by: Waiman Long <longman@xxxxxxxxxx>
Acked-by: John Donnelly <john.p.donnelly@xxxxxxxxxx>