All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josef Bacik <jbacik@fb.com>, stable <stable@vger.kernel.org>,
	Andi Kleen <andi@firstfloor.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>, Chris Mason <clm@fb.com>
Subject: Re: Name hashing function causing a perf regression
Date: Mon, 15 Sep 2014 09:35:54 -0700	[thread overview]
Message-ID: <20140915163554.GC15712@kroah.com> (raw)
In-Reply-To: <CA+55aFyFYzXdPCR3nyjJBTYbEbTb1isrGJX1kDHe4EKjXTu2sA@mail.gmail.com>

On Mon, Sep 15, 2014 at 09:22:57AM -0700, Linus Torvalds wrote:
> On Mon, Sep 15, 2014 at 8:55 AM, Josef Bacik <jbacik@fb.com> wrote:
> >
> > I can't test on 3.17 proper since the Fusion IO driver doesn't build
> > properly there and I'm not being paid to work on it anymore so I'm not
> > fixing it ;).  Thanks for fixing this, I've pulled back 99d263d4c5b2 which
> > will do us just fine.
> 
> Ok. I'm cc'ing stable to know that
> 
>     99d263d4c5b2 ("vfs: fix bad hashing of dentries")
> 
> should be added to the queues for 3.10+.
> 
> Greg&co - it's a simple fix for a performance regression. Not
> end-of-the-world, but if it ends up being in the FB kernel trees,
> might as well get it back-ported to the other stable trees too.
> 
> The other performance issues I found are actually potentially worse,
> but they aren't regressions and they hit only when using namespaces.
> Which mostly nobody does on old kernels anyway. More of a "systemd
> uses namespaces for /tmp, and then it's quite noticeable as slowing
> down pathname lookups there if you benchmark it".
> 
> So the single commit Josef mentions is likely sufficient for stable.

Thanks, now queued up.  Note, I had to change the 3.10-stable patch a
bit due to some rejects.

Here's a diff of the diffs to show the difference if anyone wants to
check it.

thanks,

greg k-h


--- queue-3.16/vfs-fix-bad-hashing-of-dentries.patch	2014-09-15 09:27:57.072950053 -0700
+++ queue-3.10/vfs-fix-bad-hashing-of-dentries.patch	2014-09-15 09:29:06.851839582 -0700
@@ -76,13 +76,13 @@
 
 --- a/fs/dcache.c
 +++ b/fs/dcache.c
-@@ -106,8 +106,7 @@ static inline struct hlist_bl_head *d_ha
+@@ -108,8 +108,7 @@ static inline struct hlist_bl_head *d_ha
  					unsigned int hash)
  {
  	hash += (unsigned long) parent / L1_CACHE_BYTES;
--	hash = hash + (hash >> d_hash_shift);
--	return dentry_hashtable + (hash & d_hash_mask);
-+	return dentry_hashtable + hash_32(hash, d_hash_shift);
+-	hash = hash + (hash >> D_HASHBITS);
+-	return dentry_hashtable + (hash & D_HASHMASK);
++	return dentry_hashtable + hash_32(hash, D_HASHBITS);
  }
  
  /* Statistics gathering. */
@@ -96,7 +96,7 @@
  #include <asm/uaccess.h>
  
  #include "internal.h"
-@@ -1629,8 +1630,7 @@ static inline int nested_symlink(struct
+@@ -1647,8 +1648,7 @@ static inline int can_lookup(struct inod
  
  static inline unsigned int fold_hash(unsigned long hash)
  {

  parent reply	other threads:[~2014-09-15 16:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 19:30 Name hashing function causing a perf regression Josef Bacik
2014-09-12 19:11 ` Andi Kleen
2014-09-12 19:21   ` Linus Torvalds
2014-09-12 19:52     ` Josef Bacik
2014-09-12 20:39       ` Linus Torvalds
2014-09-12 21:25         ` Josef Bacik
2014-09-12 22:01           ` Linus Torvalds
2014-09-12 22:08             ` Josef Bacik
2014-09-12 22:25               ` Linus Torvalds
2014-09-13 18:58                 ` Linus Torvalds
2014-09-15  1:32                   ` Linus Torvalds
2014-09-15  2:49                     ` Tetsuo Handa
2014-09-15  3:37                       ` Linus Torvalds
2014-09-15  4:58                         ` Tetsuo Handa
2014-09-15 14:17                           ` Linus Torvalds
2014-09-15 15:55                     ` Josef Bacik
2014-09-15 16:22                       ` Linus Torvalds
2014-09-15 16:25                         ` Al Viro
2014-09-15 16:33                           ` Linus Torvalds
2014-09-15 16:35                         ` Greg KH [this message]
2014-09-15 16:45                           ` Linus Torvalds
2014-09-15 16:53                             ` Jiri Slaby
2014-09-15 17:31                             ` Greg KH

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=20140915163554.GC15712@kroah.com \
    --to=greg@kroah.com \
    --cc=andi@firstfloor.org \
    --cc=clm@fb.com \
    --cc=hch@infradead.org \
    --cc=jbacik@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.