linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH][RFC] %pd - for printing dentry name
Date: Thu, 4 Feb 2010 08:02:06 -0800	[thread overview]
Message-ID: <20100204160206.GG6676@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1002040715570.3707@localhost.localdomain>

On Thu, Feb 04, 2010 at 07:29:25AM -0800, Linus Torvalds wrote:
> 
> 
> On Tue, 2 Feb 2010, Paul E. McKenney wrote:
> > 
> > One stupid question: why are the hash and length ints rather than shorts?
> > Doesn't the maximum filename length fit into a 16-bit short?  In fact,
> > doesn't the maximum length of a full pathname fit into a 16-bit short?
> 
> Yes, the name length could easily be just 16 bits. 
> 
> The hash, though, is a different matter. We actually want lots of bits to 
> spread out the dentries and 16 bits for hashing would be too small (on my 
> machine, the dentry cache hash table has half a million entries and takes 
> 4MB of space - space I'll happily give it to keep the hash chains short).
> 
> So we need at least 20 bits (and probably more on big machines).
> 
> Now, we could decide that having just 16 bits for the name hash is enough, 
> because we do mix in the address of the 'parent' dentry, and we might 
> decide that that is worth a few bits (taking the number of total bits up 
> to enough to look up half a million entries)
> 
> We could also use bitfields, and give the name length say 10 bits, and 22 
> bits to the hash, which togethr with the extra bits from the parent 
> pointer might well work out fine.
> 
> It might be worth trying. But is playing that kind of game worth four 
> extra characters in the inline name? If it were to make the difference 
> between "core dentry fields fit in a cacheline" vs "needs two cachelines", 
> then maybe it would be worth it. But I don't think that's the case.

Ah, good point on the hash size.  And given that DNAME_INLINE_LEN_MIN
is 40 characters on 32-bit systems and 32 characters on 64-bit systems,
I agree that while a four-character increase might be nice, it cannot be
said to be an emergency.

							Thanx, Paul

  reply	other threads:[~2010-02-04 16:02 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
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 [this message]
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=20100204160206.GG6676@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).