public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Andrew Hunter <ahh@google.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] core-kernel: use multiply instead of shifts in hash_64
Date: Tue, 10 Jul 2012 17:35:17 +0400	[thread overview]
Message-ID: <4FFC2F95.7080003@msgid.tls.msk.ru> (raw)
In-Reply-To: <20120702202534.GC844@google.com>

On 03.07.2012 00:25, Andrew Hunter wrote:
> diff --git a/include/linux/hash.h b/include/linux/hash.h
> index b80506b..daabc3d 100644
> --- a/include/linux/hash.h
> +++ b/include/linux/hash.h
> @@ -34,7 +34,9 @@
>  static inline u64 hash_64(u64 val, unsigned int bits)
>  {
>  	u64 hash = val;
> -
> +#if BITS_PER_LONG == 64
> +	hash *= GOLDEN_RATIO_PRIME_64;
> +#else
>  	/*  Sigh, gcc can't optimise this alone like it does for 32 bits. */

Hmm.  Does this comment make sense here now?

Thanks,

/mjt

  reply	other threads:[~2012-07-10 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 20:25 [PATCH 1/1] core-kernel: use multiply instead of shifts in hash_64 Andrew Hunter
2012-07-10 13:35 ` Michael Tokarev [this message]
2012-07-12 20:51   ` Andrew Hunter
  -- strict thread matches above, loose matches on Subject: below --
2012-06-15 22:18 Andrew Hunter

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=4FFC2F95.7080003@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=ahh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    /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