]> git.karo-electronics.de Git - mv-sheeva.git/commit
rds: recycle FMRs through lockless lists
authorChris Mason <chris.mason@oracle.com>
Fri, 11 Jun 2010 18:17:59 +0000 (11:17 -0700)
committerAndy Grover <andy.grover@oracle.com>
Thu, 9 Sep 2010 01:15:28 +0000 (18:15 -0700)
commit6fa70da6081bbcf948801fd5ee0be4d222298a43
tree519fef6c63abe15d80173ad25c7cd5aae673df55
parent0f4b1c7e89e699f588807a914ec6e6396c851a72
rds: recycle FMRs through lockless lists

FRM allocation and recycling is performance critical and fairly lock
intensive.  The current code has a per connection lock that all
processes bang on and it becomes a major bottleneck on large systems.

This changes things to use a number of cmpxchg based lists instead,
allowing us to go through the whole FMR lifecycle without locking inside
RDS.

Zach Brown pointed out that our usage of cmpxchg for xlist removal is
racey if someone manages to remove and add back an FMR struct into the list
while another CPU can see the FMR's address at the head of the list.

The second CPU might assume the list hasn't changed when in fact any
number of operations might have happened in between the deletion and
reinsertion.

This commit maintains a per cpu count of CPUs that are currently
in xlist removal, and establishes a grace period to make sure that
nobody can see an entry we have just removed from the list.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
net/rds/ib_rdma.c
net/rds/xlist.h [new file with mode: 0644]