locking/percpu-rwsem: Make use of the rcu_sync infrastructure
authorOleg Nesterov <oleg@redhat.com>
Fri, 21 Aug 2015 17:42:57 +0000 (19:42 +0200)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 6 Oct 2015 18:25:31 +0000 (11:25 -0700)
commit001dac627ff37433d5528ffb0d897cd19c2b1e43
tree800865c4653a6a3b8b2601a812e2ea609d637d39
parent95b19f684c61ffc9b039e02c5d1113c2d8cd7105
locking/percpu-rwsem: Make use of the rcu_sync infrastructure

Currently down_write/up_write calls synchronize_sched_expedited()
twice, which is evil.  Change this code to rely on rcu-sync primitives.
This avoids the _expedited "big hammer", and this can be faster in
the contended case or even in the case when a single thread does
down_write/up_write in a loop.

Of course, a single down_write() will take more time, but otoh it
will be much more friendly to the whole system.

To simplify the review this patch doesn't update the comments, fixed
by the next change.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
include/linux/percpu-rwsem.h
kernel/locking/percpu-rwsem.c