[PATCH 4/4] dcache: Use rwlock as the underlying lock in rename_lock

From: Waiman Long
Date: Wed Jul 03 2013 - 21:53:15 EST


This patch converts the underlying lock in rename_lock from spinlock
to a read/write lock. This allows multiple blocking readers to proceed
concurrently which is not possible with a spinlock implementation.

As contention of the rename_lock in the d_path() function is a
bottleneck when the perf tool is used to record performance data on
a large SMP system with many cores, converting rename_lock to use
read/write lock will eliminate this bottleneck and the skewing of
perf trace data.

Signed-off-by: Waiman Long <Waiman.Long@xxxxxx>
---
fs/dcache.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 480c81f..75299cc 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -82,7 +82,7 @@ int sysctl_vfs_cache_pressure __read_mostly = 100;
EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);

static __cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lru_lock);
-__cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);
+__cacheline_aligned_in_smp DEFINE_SEQRWLOCK(rename_lock);

EXPORT_SYMBOL(rename_lock);

--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/