From: "J. Bruce Fields" <bfields@fieldses.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Jeff Layton <jeff.layton@primarydata.com>,
"Huang, Ying" <ying.huang@linux.intel.com>,
kernel test robot <ying.huang@intel.com>,
lkp@01.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec
Date: Wed, 30 Sep 2015 20:56:52 -0400 [thread overview]
Message-ID: <20151001005652.GA6396@fieldses.org> (raw)
In-Reply-To: <20150930231742.GD3902@dastard>
On Thu, Oct 01, 2015 at 09:17:42AM +1000, Dave Chinner wrote:
> Inode pointers have no entropy in the lower 9-10 bits because of
> their size, and being allocated from a slab they are all going to
> have the same set of values in the next 3-4 bits (i.e. offset into
> the slab page which is defined by sizeof(inode)). Pointers also
> have very similar upper bits, too, because they are all in kernel
> memory.
>
> hash_64 trys to fold all the entropy from the lower bits into into
> the upper bits and then takes the result from the upper bits. Hence
> if there is no entropy in either the lower or upper bits to start
> with, then the hash may not end up with much entropy in it at all...
So we have something hash_ptr() that turns out to be terrible at hashing
pointers? Argh.
(I understand you're saying this isn't necessarily the case for all
pointers, but inode pointers on their own seem likely to be a common
case, and there must be many more that are similar.)
--b.
>
> FWIW, see fs/inode.c::hash() to see how the fs code hashes inode
> numbers (called from insert_inode_hash()). It's very different
> because because inode numbers have the majority of their entropy in
> the lower bits and (usually) none in the upper bits...
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
next prev parent reply other threads:[~2015-10-01 0:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 6:49 [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec kernel test robot
2015-09-29 11:41 ` Jeff Layton
2015-09-29 23:27 ` Huang, Ying
2015-09-30 0:06 ` Jeff Layton
2015-09-30 8:35 ` Huang, Ying
2015-09-30 10:03 ` Jeff Layton
2015-09-30 23:17 ` Dave Chinner
2015-10-01 0:56 ` J. Bruce Fields [this message]
2015-10-01 11:35 ` Jeff Layton
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=20151001005652.GA6396@fieldses.org \
--to=bfields@fieldses.org \
--cc=david@fromorbit.com \
--cc=jeff.layton@primarydata.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@01.org \
--cc=ying.huang@intel.com \
--cc=ying.huang@linux.intel.com \
/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