All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Josef Bacik <jbacik@fb.com>, 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 07:17:55 -0700	[thread overview]
Message-ID: <CA+55aFyQRHnWS+z9KKKMXVL30pfN6088+7oheHNBNRPzSFujOQ@mail.gmail.com> (raw)
In-Reply-To: <201409151358.ABF81240.FFtJHOSLOOQMVF@I-love.SAKURA.ne.jp>

[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]

On Sun, Sep 14, 2014 at 9:58 PM, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> OK. I quote comment #5 and #9 of RHBZ 1061562 below.

Looks like that BZ entry is somehow restricted, so I can't see the
details, but it turns out that I think we've fixed this issue a long
time ago for other reasons.

We definitely can use a lot of memory on negative dentries (see my own
test program attached) and that will inevitably lead to *some* issues
(because we do get memory pressure and then have to get to
shrink_slabs etc to get rid of them).

But the negative dentries should be fairly easy to get rid of, and the
real problem in that bugzilla seems to be the dcache_lock. And that
dcache_lock doesn't exist at all any more, and dentries should scale
almost infinitely.

So I'd like to have some way to limit excessive negative dentries
anyway, because they obviously do fill up the hash lists and use up
memory, so they can certainly be problematic, but I don't think they
are necessarily any worse than streaming a large file and filling up
memory that way. Except, likely, that the "streaming a large file" is
so much more common that we may well have more problems with negative
dentries just because nobody actually does this in practice. I didn't
see anything obvious from my test-program, but I didn't run any real
latency test or anything, just a "can't tell a difference in normal
use" aside from the normal "ok, no free memory".

                 Linus

[-- Attachment #2: negative.c --]
[-- Type: text/x-csrc, Size: 215 bytes --]

int main(int argc, char *argv)
{
	int i;
	char name[] = "a0000000000";

	for (;;) {
		char *p = name + 10;
		while (++*p > '9') {
			if (*p == 'b')
				return;
			*p = '0';
			--p;
		}
		stat(name);
	}
	return 0;
}

  reply	other threads:[~2014-09-15 14:17 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 [this message]
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+55aFyQRHnWS+z9KKKMXVL30pfN6088+7oheHNBNRPzSFujOQ@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=penguin-kernel@i-love.sakura.ne.jp \
    --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.