On 18 Oct 2022 13:37:20 -0400 Waiman Long<longman@xxxxxxxxxx>
On 10/18/22 10:13, Mukesh Ojha wrote:They individually add RWSEM_READER_BIAS to count before taking wait_lock,
On 10/18/2022 4:44 PM, Hillf Danton wrote:This is under wait_lock protection. So no parallel execution is possible.
On 17 Oct 2022 17:13:55 -0400 Waiman Long<longman@xxxxxxxxxx>
@@ -1067,13 +1119,33 @@ rwsem_down_read_slowpath(struct rw_semaphoreCould a couple of CPUs go read slow path in parallel?
return sem;
}
adjustment += RWSEM_FLAG_WAITERS;
+ } else if ((count & RWSEM_FLAG_HANDOFF) &&
+ ((count & RWSEM_LOCK_MASK) == RWSEM_READER_BIAS)) {
and the check for BIAS here does not cover the case of readers in parallel.
Is this intended?
Hillf