public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* dentry cache order 7 is broken
@ 2001-02-08  7:15 dean gaudet
  2001-02-08  8:10 ` David S. Miller
  2001-02-09  1:21 ` Linus Torvalds
  0 siblings, 2 replies; 6+ messages in thread
From: dean gaudet @ 2001-02-08  7:15 UTC (permalink / raw)
  To: linux-kernel

this looks to be a problem going back all the way to at least 2.2.

if you've got 512Mb of RAM you end up with a dentry cache of order 7 --
65536 entries.

this results in a D_HASHBITS of 16.  if you look at d_hash it contains
this code:

	hash = hash ^ (hash >> D_HASHBITS) ^ (hash >> D_HASHBITS*2);

D_HASHBITS*2 = 32, which on an x86 results in a shift of 0.  (ia32 is
defined to mask a variable shift down to the low 5 bits and use the low 5
bits.)

this results in a hash with very little perturbance at all, since the 1st
and 3rd terms of the xor are equal and cancel... and the resulting
performance is pretty abysmal.  i'm getting hash chains with well over 100
entries in them just doing a find on the kernel source tree.

if i hard code to order 8 then i get nice well distributed hash chains, 5
entries max.

also, for order > 7, was the real intention to use a shift of
(order*2)&31?

-dean

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-02-09  1:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-08  7:15 dentry cache order 7 is broken dean gaudet
2001-02-08  8:10 ` David S. Miller
2001-02-08  8:22   ` Mitchell Blank Jr
2001-02-08  9:22     ` David S. Miller
2001-02-09  0:36   ` dean gaudet
2001-02-09  1:21 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox