]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xfs: convert inode cache lookups to use RCU locking
authorDave Chinner <dchinner@redhat.com>
Fri, 17 Dec 2010 06:29:43 +0000 (17:29 +1100)
committerDave Chinner <david@fromorbit.com>
Fri, 17 Dec 2010 06:29:43 +0000 (17:29 +1100)
commit1a3e8f3da09c7082d25b512a0ffe569391e4c09a
treec717ebe79e1f969f929d1fe6fb044fb59114449f
parentd95b7aaf9ab6738bef1ebcc52ab66563085e44ac
xfs: convert inode cache lookups to use RCU locking

With delayed logging greatly increasing the sustained parallelism of inode
operations, the inode cache locking is showing significant read vs write
contention when inode reclaim runs at the same time as lookups. There is
also a lot more write lock acquistions than there are read locks (4:1 ratio)
so the read locking is not really buying us much in the way of parallelism.

To avoid the read vs write contention, change the cache to use RCU locking on
the read side. To avoid needing to RCU free every single inode, use the built
in slab RCU freeing mechanism. This requires us to be able to detect lookups of
freed inodes, so enѕure that ever freed inode has an inode number of zero and
the XFS_IRECLAIM flag set. We already check the XFS_IRECLAIM flag in cache hit
lookup path, but also add a check for a zero inode number as well.

We canthen convert all the read locking lockups to use RCU read side locking
and hence remove all read side locking.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
fs/xfs/linux-2.6/xfs_sync.c
fs/xfs/xfs_iget.c
fs/xfs/xfs_inode.c