Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236851

Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Dave Chinner <david@fromorbit.com>
Newsgroups linux.kernel
Subject Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec
Date Thu, 01 Oct 2015 01:20:02 +0200
Message-ID <qeyPg-2Iv-3@gated-at.bofh.it> (permalink)
References <qdAq6-6nd-3@gated-at.bofh.it> <qe1zY-5qs-9@gated-at.bofh.it> <qecvn-4eq-3@gated-at.bofh.it> <qed86-5cH-13@gated-at.bofh.it> <qel5E-85q-13@gated-at.bofh.it> <qemuK-1NX-15@gated-at.bofh.it>
X-Original-To Jeff Layton <jeff.layton@primarydata.com>
X-Ironport-Anti-Spam-Filtered true
X-Ironport-Anti-Spam-Result A2BACwANbQxWPK2+LHlegySBQYJdg32iVQaLDZErBAICgTdNAQEBAQEBBwEBAQFAAT+EJQEBBCcTHCMQCAMYCSUPBSUDBxoTiC3MCgEBAQcCAR8ZhhOFRIUNB4MYgRQBBJV4jQ6PDIxJgnMegWYsM4l6AQEB
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc "Huang, Ying" <ying.huang@linux.intel.com>, kernel test robot <ying.huang@intel.com>, lkp@01.org, LKML <linux-kernel@vger.kernel.org>, bfields@fieldses.org
X-Original-Date Thu, 1 Oct 2015 09:17:42 +1000
X-Original-Message-ID <20150930231742.GD3902@dastard>
X-Original-References <87h9mfhwcj.fsf@yhuang-dev.intel.com> <20150929074151.0fe32fc9@tlielax.poochiereds.net> <87lhbokdqd.fsf@yhuang-dev.intel.com> <20150929200613.66c3ab4f@synchrony.poochiereds.net> <871tdg718x.fsf@yhuang-dev.intel.com> <20150930060359.070dba46@tlielax.poochiereds.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1236851

Show key headers only | View raw


On Wed, Sep 30, 2015 at 06:03:59AM -0400, Jeff Layton wrote:
> Thanks for testing it and catching the problem in the first place!
> 
> FWIW, the problem seems to have been bad hash distribution generated by
> hash_ptr on struct inode pointers. When the cache had ~10000 entries in
> it total, one of the hash chains had almost 2000 entries. When I
> switched to hashing on inode->i_ino, the distribution was much better.
> 
> I'm not sure if it was just rotten luck or there is something about
> inode pointers that makes hash_ptr generate a lot of duplicates. That
> really could use more investigation...

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...

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec Jeff Layton <jeff.layton@primarydata.com> - 2015-09-29 13:50 +0200
  Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec "Huang\, Ying" <ying.huang@linux.intel.com> - 2015-09-30 01:30 +0200
    Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec Jeff Layton <jeff.layton@primarydata.com> - 2015-09-30 02:10 +0200
      Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec "Huang\, Ying" <ying.huang@linux.intel.com> - 2015-09-30 10:40 +0200
        Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec Jeff Layton <jeff.layton@primarydata.com> - 2015-09-30 12:10 +0200
          Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec Dave Chinner <david@fromorbit.com> - 2015-10-01 01:20 +0200
            Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec "J. Bruce Fields" <bfields@fieldses.org> - 2015-10-01 03:00 +0200
            Re: [lkp] [nfsd] 4aac1bf05b: -2.9% fsmark.files_per_sec Jeff Layton <jeff.layton@primarydata.com> - 2015-10-01 13:40 +0200

csiph-web