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 itOk.
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.
This patch makes the wait_lock taking and the call to __rwsem_do_wake()But if the lock is taken by readers, like you suggest above, there
optional if at least one spinning writer is present.
cannot be any active spinners. We always block in these cases.