All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Josef Bacik <jbacik@fb.com>
Cc: 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: Sun, 14 Sep 2014 18:32:12 -0700	[thread overview]
Message-ID: <CA+55aFwBDepeuKfEpZqm4RpQ=+Ba_mu53a_-p8vYWTkw-VWQaw@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFwrYRQRHnqHsTJZYX4tZiCywT5JHji23iv2q26x-VAVoQ@mail.gmail.com>

On Sat, Sep 13, 2014 at 11:58 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So if this all helps you guys, and after sufficient testing, just the
> current top commit should be self-sufficient (with two other commits
> before *if* that multiply-vs-shift makes a difference)
>
>     99d263d4c5b2 (HEAD, master) vfs: fix bad hashing of dentries
>
> and if it *doesn't* help, and you still see problems, please holler.

Btw, please if at all possible, give the 3.17-rc5 release a test on
the load that you saw problems with.

Because of the whole dentry hashing issue, I took another look at name
lookup performance, and found a few more problems in this area.

The biggest problem only affected the fairly unusual case of a
directory that was mounted differently in different namespaces, and it
may well be that you don't actually have that situation at all. I
found it almost by mistake when checking performance consistency and
noticing that my "/tmp" directory lookups were much slower than
everything else. The pathname lookup incorrectly dropped out of RCU
mode for that case due to two independent bugs (one hit normal lookups
of such directories, the other hit just the ".." case).

I also hit a small CPU pipeline hickup in link_path_walk() that is
probably specific to just the store buffer forwarding of x86-64, but
could possibly hit other 64-bit cases too. I doubt it's noticeable for
your case, but it showed up pretty clearly in the profiles when I was
checking that everything looked ok.

All of them should be fixed in the -rc5 I just pushed out. At least I

I do have another case I'm not entirely happy about - our negative
lookups (ie looking up a pathname that doesn't exist) hit in the
dcache for real filesystems and perform really well, but they suck for
tmpfs. Al, we turn off negative dentry caches for tmpfs because
simple_dentry_operations uses

        .d_delete = always_delete_dentry,

Do we care? It's noticeable in benchmarks: it's almost an order of
magnitude difference when looking up non-existent files. I can look up
a non-existent file 23M times per second on ext4, but only 3.3M on
/tmp.

Anyway, I'm not sure FB does a lot of lookups of nonexistent files,
but there are some loads that really do that a lot.  And we're in the
odd situation that it's actually *much* faster on a real filesystem
than it is on a RAM filesystem like /tmp.

                   Linus

  reply	other threads:[~2014-09-15  1:32 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 [this message]
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
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='CA+55aFwBDepeuKfEpZqm4RpQ=+Ba_mu53a_-p8vYWTkw-VWQaw@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=clm@fb.com \
    --cc=hch@infradead.org \
    --cc=jbacik@fb.com \
    --cc=linux-fsdevel@vger.kernel.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.