RDS: make socket bind/release locking scheme simple and more efficient
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>
Fri, 3 Feb 2012 16:09:23 +0000 (11:09 -0500)
committerSantosh Shilimkar <ssantosh@kernel.org>
Wed, 30 Sep 2015 16:43:24 +0000 (12:43 -0400)
commit8b0a6b461e2ccc95363e0547aa4f43ba2e02b096
treeab5d09ccb54b090f1ecf02af7466b236a0163328
parent59fe4606748f7016e9e02bbd26da185f8620661a
RDS: make socket bind/release locking scheme simple and more efficient

RDS bind and release locking scheme is very inefficient. It
uses RCU for maintaining the bind hash-table which is great but
it also needs to hold spinlock for [add/remove]_bound(). So
overall usecase, the hash-table concurrent speedup doesn't pay off.
In fact blocking nature of synchronize_rcu() makes the RDS
socket shutdown too slow which hurts RDS performance since
connection shutdown and re-connect happens quite often to
maintain the RC part of the protocol.

So we make the locking scheme simpler and more efficient by
replacing spin_locks with reader/writer locks and getting rid
off rcu for bind hash-table.

In subsequent patch, we also covert the global lock with per-bucket
lock to reduce the global lock contention.

Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
net/rds/af_rds.c
net/rds/bind.c