[<prev] [next>] [day] [month] [year] [list]
Message-ID: <0baab14d-abea-4248-e6d5-23c465f0a4a5@redhat.com>
Date: Thu, 16 Feb 2023 16:07:25 -0500
From: Waiman Long <longman@...hat.com>
To: Hillf Danton <hdanton@...a.com>
Cc: 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
Subject: Re: [PATCH 2/2] locking/rwsem: Wake up all readers for wait queue
waker
On 2/13/23 22:09, Hillf Danton wrote:
> On Mon, 13 Feb 2023 14:48:32 -0500 Waiman Long <longman@...hat.com>
>>
>> @@ -1281,7 +1282,7 @@ static struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem)
>> raw_spin_lock_irqsave(&sem->wait_lock, flags);
>>
>> if (!list_empty(&sem->wait_list))
>> - rwsem_mark_wake(sem, RWSEM_WAKE_READ_OWNED, &wake_q);
>> + rwsem_mark_wake(sem, RWSEM_WAKE_READ_OWNED, &wake_q, false);
>>
>> raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
>> wake_up_q(&wake_q);
>> --
>> 2.31.1
> Downgrade is conceptually the right time to let all read waiters go
> regardless write waiter.
Still, a downgraded task is still in the read critical section and we
shouldn't introduce arbitrary latency to that. Let's focus on the easy
one and we can discuss about other possibility later.
Thanks,
Longman
Powered by blists - more mailing lists