linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Hillf Danton <hdanton@sina.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] locking/rwsem: Wake up all readers for wait queue waker
Date: Thu, 16 Feb 2023 16:07:25 -0500	[thread overview]
Message-ID: <0baab14d-abea-4248-e6d5-23c465f0a4a5@redhat.com> (raw)
In-Reply-To: <20230214030901.3250-1-hdanton@sina.com>

On 2/13/23 22:09, Hillf Danton wrote:
> On Mon, 13 Feb 2023 14:48:32 -0500 Waiman Long <longman@redhat.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


      parent reply	other threads:[~2023-02-16 21:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 19:48 [PATCH-tip 0/2] locking/rwsem: Miscellaneous rwsem enhancements Waiman Long
2023-02-13 19:48 ` [PATCH 1/2] locking/rwsem: Enable early rwsem writer lock handoff Waiman Long
2023-02-13 19:48 ` [PATCH 2/2] locking/rwsem: Wake up all readers for wait queue waker Waiman Long
     [not found] ` <20230214030901.3250-1-hdanton@sina.com>
2023-02-16 21:07   ` Waiman Long [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0baab14d-abea-4248-e6d5-23c465f0a4a5@redhat.com \
    --to=longman@redhat.com \
    --cc=boqun.feng@gmail.com \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).