From: Waiman Long <waiman.long@hp.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Jeff Layton <jlayton@redhat.com>,
Miklos Szeredi <mszeredi@suse.cz>, Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Andi Kleen <andi@firstfloor.org>,
"Chandramouleeswaran, Aswin" <aswin@hp.com>,
"Norton, Scott J" <scott.norton@hp.com>
Subject: Re: [PATCH v3 03/25] dcache: Enable lockless update of d_count in dentry structure
Date: Wed, 03 Jul 2013 16:52:52 -0400 [thread overview]
Message-ID: <51D48F24.1020406@hp.com> (raw)
In-Reply-To: <CA+55aFzRbOgBhmL3y=bgR=OakOH6RizVYD5XBc8aP9LzfMn8cA@mail.gmail.com>
On 07/03/2013 04:37 PM, Linus Torvalds wrote:
> This patch grew a lot, and that seems to be mainly because of bad reasons.
That is the main reason why I choose to implement it the way it was in
my previous version. As I add one more level to access d_lock and
d_count, I need to change a lot more files.
> I'd suggest dropping the whole
> "lockref_ret_count()"/"lockref_ret_lock()" helpers, which cause all
> the annoyance, and just make people use the members directly.
Yes, I can do that. They are used in not that many places.
> Then, just do
>
> #define d_lock d_lockref.lockref_lock
>
> or similar, so that all the existing code just continues to work,
> without the need for the syntactic changes:
>
> - spin_lock(&dentry->d_lock);
> + d_lock(dentry);
I had been thinking about that. The use of d_lock should be pretty safe
as I didn't see that variable name used in other places. I didn't do it
because I am afraid that people may say that using macro mapping like
this is not a good idea. By doing that, the patch should shrink
considerably.
> For d_count, we probably do need to have the wrapper macro:
>
> #define dentry_count(dentry) ((dentry)->d_lockref.lockref_count)
>
> and change the existing users of "dentry->d_count" to use that, but
> there are fewer of those than there are of people taking the dentry
> lock. And most of them are in fs/dcache.c and would be affected by
> this set of patches anyway.
The d_count name is not unique to the dentry structure. So files that
access d_count have to be modified explicitly.
I will see if there are more feedback and send an updated patchset by
the end of this week or early next week.
Regards,
Longman
prev parent reply other threads:[~2013-07-03 20:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 20:18 [PATCH v3 00/25] Lockless update of reference count protected by spinlock Waiman Long
2013-07-03 20:18 ` [PATCH v3 01/25] spinlock: A new lockref structure for lockless update of refcount Waiman Long
2013-07-03 20:19 ` [PATCH v3 02/25] spinlock: Enable x86 architecture to do lockless refcount update Waiman Long
2013-07-03 20:19 ` [PATCH v3 03/25] dcache: Enable lockless update of d_count in dentry structure Waiman Long
2013-07-03 20:37 ` Linus Torvalds
2013-07-03 20:52 ` Waiman Long [this message]
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=51D48F24.1020406@hp.com \
--to=waiman.long@hp.com \
--cc=andi@firstfloor.org \
--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=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=scott.norton@hp.com \
--cc=tglx@linutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).