Re: dentry cache order 7 is broken

From: David S. Miller (davem@redhat.com)
Date: Thu Feb 08 2001 - 04:22:28 EST


Mitchell Blank Jr writes:
> 1. The inode-cache has the exact same problem, but it'll require a lot
> of RAM to run into it. The buffer and page caches don't have the
> same problem.

Yep, fix attached. You just need 1GB ram to hit that case.

> 2. Given that D_HASHBITS is not a constant I wonder if there isn't
> a more efficient hash to be found. But I guess I'll leave that
> to the hashing experts.

For the moment anything is better than when you hit this
bug :-)

--- fs/inode.c.~1~ Sun Feb 4 20:45:36 2001
+++ fs/inode.c Thu Feb 8 01:21:07 2001
@@ -729,7 +729,8 @@
 static inline unsigned long hash(struct super_block *sb, unsigned long i_ino)
 {
         unsigned long tmp = i_ino + ((unsigned long) sb / L1_CACHE_BYTES);
- tmp = tmp + (tmp >> I_HASHBITS) + (tmp >> I_HASHBITS*2);
+ tmp = tmp + (tmp >> I_HASHBITS) +
+ (tmp >> (I_HASHBITS+(I_HASHBITS/2)));
         return tmp & I_HASHMASK;
 }
 
-
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/



This archive was generated by hypermail 2b29 : Thu Feb 15 2001 - 21:00:11 EST