All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Iozone <capps@iozone.org>
Cc: neilb@cse.unsw.edu.au, nfs@lists.sourceforge.net
Subject: Re: An interesting performance thing ?
Date: Wed, 14 Dec 2005 21:22:10 -0500	[thread overview]
Message-ID: <20051215022210.GB21176@fieldses.org> (raw)
In-Reply-To: <00b901c600db$5d374960$1500000a@americas.hpqcorp.net>

On Wed, Dec 14, 2005 at 12:22:38PM -0600, Iozone wrote:
>     Then the hash_long function would have done a nice job.  Since
>     one is not converting the network neutral IP address into a 
>     host binary format, here is an example of the hash distribution
>     that, I believe via experimentation, is currently being seen on 
>     Little Endian 64 Bit systems....

A little bit of fiddling about with pencil and paper shows what's
happening:  suppose longs are 64 bits and let x be a long.  Then
hash_long operates on x by multiplying it by

	 1 - 2^18 - 2^51 + 2^54 - 2^57 + 2^61 + 2^63

and then taking the high bits.

You can think of that as adding and subtracting a bunch of left-shifts.
Note that the last four terms are all shifts by at least 51 bits, so
wipe out all but the lowest 13 bits.  So if those low 13 bits are all
constant, then the only variation is from multiplication by (1 - 2^18).
But if the input is small (say the top 32 bits are all zero...) then
multiplying by (1 - 2^18) doesn't affect the high bits of the output at
all.

So in our case, where the 32 high bits are zero and we're only asking
for the top 8 bits, it looks like all but the bottom 13 bits of x (the
top 13 bits of the IP address) are ignored.

--b.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

      parent reply	other threads:[~2005-12-15  2:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14 18:22 An interesting performance thing ? Iozone
2005-12-14 22:26 ` Neil Brown
2005-12-14 22:46   ` Chuck Lever
2005-12-14 23:47     ` Iozone
2005-12-15  0:02       ` Neil Brown
2005-12-15  0:43         ` Chuck Lever
2005-12-15  0:57           ` Neil Brown
2005-12-15  0:59             ` Chuck Lever
2005-12-16 10:15           ` Aurélien Charbon
2005-12-16 14:23             ` Iozone
2005-12-15  2:32         ` J. Bruce Fields
2005-12-15  4:51           ` Iozone
2005-12-15 14:49             ` J. Bruce Fields
2005-12-15 15:36               ` Iozone
2005-12-15 16:14                 ` J. Bruce Fields
2005-12-15 16:41                   ` Iozone
2005-12-15 17:07                     ` J. Bruce Fields
2005-12-16  1:25                   ` Neil Brown
2005-12-16  3:59                     ` Iozone
2005-12-14 22:50   ` Iozone
2005-12-15  2:22 ` J. Bruce Fields [this message]

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=20051215022210.GB21176@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=capps@iozone.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=nfs@lists.sourceforge.net \
    /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.