From: Waiman Long <waiman.long@hp.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, Jason Low <jason.low2@hp.com>,
Scott J Norton <scott.norton@hp.com>,
Douglas Hatch <doug.hatch@hp.com>
Subject: Re: [PATCH v2] locking/rwsem: reduce spinlock contention in wakeup after up_read/up_write
Date: Fri, 24 Apr 2015 10:56:14 -0400 [thread overview]
Message-ID: <553A598E.8080900@hp.com> (raw)
In-Reply-To: <1429824690.10273.41.camel@stgolabs.net>
On 04/23/2015 05:31 PM, Davidlohr Bueso wrote:
> It would be nice to not run into this by accident. Please CC all
> relevant parties ;)
>
> On Thu, 2015-04-23 at 14:24 -0400, Waiman Long wrote:
>> In up_read()/up_write(), rwsem_wake() will be called whenever it
>> detects that some writers/readers are waiting. The rwsem_wake()
>> function will take the wait_lock and call __rwsem_do_wake() to do
>> the real wakeup. This can be a problem especially for up_read()
>> where many readers can potentially call rwsem_wake() at more or less
>> the same time even though a single call should be enough. This will
>> cause contention in the wait_lock cacheline resulting in delay of
>> the up_read/up_write operations.
> Ok.
>
>> This patch makes the wait_lock taking and the call to __rwsem_do_wake()
>> optional if at least one spinning writer is present.
> But if the lock is taken by readers, like you suggest above, there
> cannot be any active spinners. We always block in these cases.
Yes, you are right. Will fix the log message.
Cheers,
Longman
prev parent reply other threads:[~2015-04-24 14:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 18:24 [PATCH v2] locking/rwsem: reduce spinlock contention in wakeup after up_read/up_write Waiman Long
2015-04-23 20:42 ` Jason Low
2015-04-24 14:55 ` Waiman Long
2015-04-23 21:31 ` Davidlohr Bueso
2015-04-24 14:56 ` 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=553A598E.8080900@hp.com \
--to=waiman.long@hp.com \
--cc=dave@stgolabs.net \
--cc=doug.hatch@hp.com \
--cc=jason.low2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=scott.norton@hp.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.