Re: [PATCH] dentry and inode cache hash algorithm performance changes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Jose R. Santos" <jrsantos@austin.ibm.com> wrote:
>
> diff -Nru a/fs/inode.c b/fs/inode.c
> --- a/fs/inode.c	Fri Apr 30 12:14:23 2004
> +++ b/fs/inode.c	Fri Apr 30 12:14:23 2004
> @@ -671,8 +671,9 @@
>  
>  static inline unsigned long hash(struct super_block *sb, unsigned long hashval)
>  {
> -	unsigned long tmp = hashval + ((unsigned long) sb / L1_CACHE_BYTES);
> -	tmp = tmp + (tmp >> I_HASHBITS);
> +	unsigned long tmp = (hashval + ((unsigned long) sb) ^ (GOLDEN_RATIO_PRIME + hashval)
> +			/ L1_CACHE_BYTES);
> +	tmp = tmp + ((tmp ^ GOLDEN_RATIO_PRIME) >> I_HASHBITS);
>  	return tmp & I_HASHMASK;
>  }
>  

Are you sure about this?  It's doing:

	tmp = hashval + sb ^ ((GOLDEN_RATIO_PRIME + hashval) / L1_CACHE_BYTES)

should it not be:

	tmp = hashval + (sb ^ (GOLDEN_RATIO_PRIME + hashval)) / L1_CACHE_BYTES

?


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux