]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - fs/xfs/xfs_mount.c
xfs: lockless per-ag lookups
authorDave Chinner <dchinner@redhat.com>
Wed, 22 Sep 2010 00:47:20 +0000 (10:47 +1000)
committerAlex Elder <aelder@sgi.com>
Mon, 18 Oct 2010 20:07:44 +0000 (15:07 -0500)
commite176579e70118ed7cfdb60f963628fe0ca771f3d
treee2d252fcd692aa4e3907300521e2af81c974f875
parentbd32d25a7cf7242512e77e70bab63df4402ab91c
xfs: lockless per-ag lookups

When we start taking a reference to the per-ag for every cached
buffer in the system, kernel lockstat profiling on an 8-way create
workload shows the mp->m_perag_lock has higher acquisition rates
than the inode lock and has significantly more contention. That is,
it becomes the highest contended lock in the system.

The perag lookup is trivial to convert to lock-less RCU lookups
because perag structures never go away. Hence the only thing we need
to protect against is tree structure changes during a grow. This can
be done simply by replacing the locking in xfs_perag_get() with RCU
read locking. This removes the mp->m_perag_lock completely from this
path.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
fs/xfs/linux-2.6/xfs_sync.c
fs/xfs/xfs_ag.h
fs/xfs/xfs_mount.c