linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH][RFC] %pd - for printing dentry name
Date: Tue, 2 Feb 2010 09:13:33 -0700	[thread overview]
Message-ID: <20100202161333.GH1331@parisc-linux.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1002020752580.3664@localhost.localdomain>

On Tue, Feb 02, 2010 at 07:56:36AM -0800, Linus Torvalds wrote:
> On Tue, 2 Feb 2010, Matthew Wilcox wrote:
> > 
> > How about doing this:
> > 
> >  struct qstr {
> > -	const unsigned char *name;
> > +	const unsigned char name[0];
> >  }
> > 
> >  struct dentry {
> > -	struct qstr d_name;
> > +	struct qstr *d_name;
> > -	unsigned char d_iname[DNAME_INLINE_LEN_MIN];    /* small names */
> > +	union {
> > +		struct qstr d_iname;
> > +		char pad[DNAME_INLINE_LEN_MIN];
> > +	};
> >  }
> > 
> > Doesn't increase the size of struct dentry, and puts the hash and len
> > with the name.  Increases long name allocations by 8 bytes each.
> 
> Conceptually nice, but in practice that's absolutely horrible.
> 
> Why? Because now the dentry lookup logic has to follow an additional 
> pointer just to verify the hash and the length of the name. That's some of 
> the hottest code we have, and the _last_ thing we want is another pointer 
> dereference and cache access in the path that looks up the dentry hash 
> chains.

I'd thought it was in the same cacheline ... but that's not generally
true since dentries are so large.  And the d_name is at the other end
of the dentry, so they're guaranteed to be in different cachelines.  Bum.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2010-02-02 16:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 22:25 [PATCH][RFC] %pd - for printing dentry name Al Viro
2010-02-01 22:34 ` Al Viro
2010-02-01 22:37 ` Linus Torvalds
2010-02-01 23:18   ` Al Viro
2010-02-02  1:06     ` Al Viro
2010-02-02  5:55       ` Eric W. Biederman
2010-02-02 17:01         ` Al Viro
2010-02-02 18:10           ` Olivier Galibert
2010-02-02 19:19           ` Eric W. Biederman
2010-02-03  3:04             ` Al Viro
2010-02-04  4:53               ` Al Viro
2010-02-02  4:22     ` Linus Torvalds
2010-02-02  5:00       ` Al Viro
2010-02-02  6:36         ` Nick Piggin
2010-02-04  6:02           ` Al Viro
2010-02-04  7:40             ` Nick Piggin
2010-02-02  6:53     ` Paul E. McKenney
2010-02-02  7:09       ` Al Viro
2010-02-02 13:32         ` Matthew Wilcox
2010-02-02 15:56           ` Linus Torvalds
2010-02-02 16:13             ` Matthew Wilcox [this message]
2010-02-02 16:43           ` Al Viro
2010-02-03 10:52         ` Paul E. McKenney
2010-02-03  2:49       ` Paul E. McKenney
2010-02-04 15:29         ` Linus Torvalds
2010-02-04 16:02           ` Paul E. McKenney
2010-02-04 17:13             ` Linus Torvalds
2010-02-04 17:36               ` Al Viro
2010-02-07 16:34                 ` Paul E. McKenney
2010-02-01 22:45 ` Joe Perches

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=20100202161333.GH1331@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).