On 11/11/21 15:26, Peter Zijlstra wrote:
On Thu, Nov 11, 2021 at 02:36:52PM -0500, Waiman Long wrote:That is true. The only downside is that we have to read the count first in rwsem_out_nolock_clear_flags(). Since this is not a fast path, it should be OK to do that.
@@ -434,6 +430,7 @@ static void rwsem_mark_wake(struct rw_semaphore *sem,Do we really need this flag? Wouldn't it be the same as waiter-is-first
if (!(oldcount & RWSEM_FLAG_HANDOFF) &&
time_after(jiffies, waiter->timeout)) {
adjustment -= RWSEM_FLAG_HANDOFF;
+ waiter->handoff_set = true;
lockevent_inc(rwsem_rlock_handoff);
}
AND sem-has-handoff ?