[<prev] [next>] [day] [month] [year] [list]
Message-ID: <28264558-5f3f-9521-ced2-2c94a27002ec@redhat.com>
Date: Wed, 19 Oct 2022 11:02:00 -0400
From: Waiman Long <longman@...hat.com>
To: Hillf Danton <hdanton@...a.com>
Cc: Mukesh Ojha <quic_mojha@...cinc.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
linux-kernel@...r.kernel.org, john.p.donnelly@...cle.com,
Ting11 Wang 王婷 <wangting11@...omi.com>
Subject: Re: [PATCH v3 4/5] locking/rwsem: Enable direct rwsem lock handoff
On 10/19/22 03:05, Hillf Danton wrote:
> On 18 Oct 2022 22:49:02 -0400 Waiman Long <longman@...hat.com>
>> On 10/18/22 22:29, Hillf Danton wrote:
>>> If handoff grants rwsem to a read waiter then the read fast path may revive.
>> I don't quite understand what you mean by "read fast path may revive".
> Subsequent readers may take rwsem without going the slow path after a
> read waiter is granted.
That may not be true. As long as there are still waiters in the wait
queue, a reader has to go into the slow path and queued up in the wait
queue. This is is to prevent a continuous stream of readers from
starving writers in the wait queue.
>
> OTOH even after the check for single BIAS, another reader may come in
> and add its BIAS to count, which builds the same count as multiple
> readers came in before the check.
That is true, but hopefully we will eventually run out reader trying to
get a read lock on a given rwsem.
Cheers,
Longman
Powered by blists - more mailing lists