linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Miklos Szeredi <miklos@szeredi.hu>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] <linux/stringhash.h>: fix end_name_hash() for 64bit long
Date: Mon, 5 Feb 2018 09:57:23 -0800	[thread overview]
Message-ID: <CA+55aFz=4jx5f0NVes02rtKY9rW+bdEMUdRh0ukK4UPW3UkFeg@mail.gmail.com> (raw)
In-Reply-To: <CAOQ4uxi4KrCYAVFbWE=4ptSgpVdPEaDDHPVFvFuHvrhsQ69uTA@mail.gmail.com>

On Mon, Feb 5, 2018 at 9:51 AM, Amir Goldstein <amir73il@gmail.com> wrote:
>
> and hash_32_generic() is just __hash_32() with zero shift.

Right. But that __hash_32() is very expensive and doesn't help.

So the patch as-is doesn't seem to buy anything, and only adds cost.

Note that the dentry code is a bit unusual, in that the final shift is
done later, in d_hash(). And that takes the _high_ bits of the hash,
so unlike a lot of other hash functions, the name hashing doesn't need
to try to spread the bits down to the low bits. The intermediate hash
value should be fine without any extra spreading.

Anyway, we did have numbers at one point. That's what really matters:
how good the actual hashing ends up being. So for me to take the
patch, I would need to see that it actually improves the hash bucket
spreading enough to be worth the cost.

            Linus

  reply	other threads:[~2018-02-05 17:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 17:32 [RFC][PATCH] <linux/stringhash.h>: fix end_name_hash() for 64bit long Amir Goldstein
2018-02-05 17:36 ` Linus Torvalds
2018-02-05 17:51   ` Amir Goldstein
2018-02-05 17:57     ` Linus Torvalds [this message]
2018-02-05 18:35       ` Amir Goldstein
2018-02-05 18:37         ` Linus Torvalds
2018-02-09 18:33 ` Linus Torvalds
2018-02-11 14:51   ` Amir Goldstein

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+55aFz=4jx5f0NVes02rtKY9rW+bdEMUdRh0ukK4UPW3UkFeg@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).