From: Waiman Long <Waiman.Long@hp.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Jeff Layton <jlayton@redhat.com>,
Miklos Szeredi <mszeredi@suse.cz>, Ingo Molnar <mingo@redhat.com>
Cc: Waiman Long <Waiman.Long@hp.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
"Chandramouleeswaran, Aswin" <aswin@hp.com>,
"Norton, Scott J" <scott.norton@hp.com>
Subject: [PATCH RFC 0/2] Lockless update of reference count protected by spinlock
Date: Wed, 19 Jun 2013 12:50:03 -0400 [thread overview]
Message-ID: <1371660605-19225-1-git-send-email-Waiman.Long@hp.com> (raw)
This patchset supports a generic mechanism to atomically update
a reference count that is protected by a spinlock without actually
acquiring the lock itself. If the update doesn't succeeed, the caller
will have to acquire the lock and update the reference count in the
the old way. This will help in situation where there is a lot of
spinlock contention because of frequent reference count update.
The new mechanism was designed in such a way to easily retrofit
into existing code with minimal changes. Both the spinlock and the
reference count can be accessed in the same way as before.
The d_lock and d_count fields of the struct dentry in dcache.h was
modified to use the new mechanism. This serves as an example of how
to convert existing spinlock and reference count combo to use the
new way of locklessly updating the reference count.
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Waiman Long (2):
spinlock: New spinlock_refcount.h for lockless update of refcount
dcache: Locklessly update d_count whenever possible
fs/dcache.c | 14 +++-
include/linux/dcache.h | 22 +++++-
include/linux/spinlock_refcount.h | 145 +++++++++++++++++++++++++++++++++++++
include/linux/spinlock_types.h | 19 +++++
4 files changed, 196 insertions(+), 4 deletions(-)
create mode 100644 include/linux/spinlock_refcount.h
next reply other threads:[~2013-06-19 16:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 16:50 Waiman Long [this message]
2013-06-19 16:50 ` [PATCH RFC 1/2] spinlock: New spinlock_refcount.h for lockless update of refcount Waiman Long
2013-06-19 16:50 ` [PATCH RFC 2/2] dcache: Locklessly update d_count whenever possible Waiman Long
2013-06-24 16:31 ` [PATCH RFC 0/2] Lockless update of reference count protected by spinlock 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=1371660605-19225-1-git-send-email-Waiman.Long@hp.com \
--to=waiman.long@hp.com \
--cc=aswin@hp.com \
--cc=benh@kernel.crashing.org \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mszeredi@suse.cz \
--cc=scott.norton@hp.com \
--cc=torvalds@linux-foundation.org \
--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
all inboxes | Powered by JetHome®