linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <Waiman.Long@hp.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <Waiman.Long@hp.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Chandramouleeswaran, Aswin" <aswin@hp.com>,
	"Norton, Scott J" <scott.norton@hp.com>
Subject: [PATCH 4/4] dcache: Use rwlock as the underlying lock in rename_lock
Date: Wed,  3 Jul 2013 21:52:18 -0400	[thread overview]
Message-ID: <1372902738-30693-5-git-send-email-Waiman.Long@hp.com> (raw)
In-Reply-To: <1372902738-30693-1-git-send-email-Waiman.Long@hp.com>

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@hp.com>
---
 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

  parent reply	other threads:[~2013-07-04  1:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04  1:52 [PATCH 0/4] seqlock: Add new blocking reader type & use rwlock Waiman Long
2013-07-04  1:52 ` [PATCH 1/4] seqlock: Add a new blocking reader type Waiman Long
2013-07-04  1:52 ` [PATCH 2/4] dcache: Use blocking reader seqlock when protected data are not changed Waiman Long
2013-07-04  1:52 ` [PATCH 3/4] seqlock: Allow the use of rwlock in seqlock Waiman Long
2013-07-04  1:52 ` Waiman Long [this message]
2013-08-23 22:49 ` [PATCH 0/4] seqlock: Add new blocking reader type & use rwlock Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372902738-30693-5-git-send-email-Waiman.Long@hp.com \
    --to=waiman.long@hp.com \
    --cc=aswin@hp.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scott.norton@hp.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).