Re: 2.4.X inode cache bug

From: Quim K Holland (qkholland@my-deja.com)
Date: Wed Jan 31 2001 - 02:01:49 EST


('binary' encoding is not supported, stored as-is) In <200101310202.EAA11357@smtp2.kolumbus.fi>, jukka.santala@kolumbus.fi
writes:

> Excuse me for the lack of patch in this mail,...
> In 2.4.x, linux/fs/inode.c has a hash() function with a small
> slip-up. The inode hash-value is initialized with "unsigned
> long tmp = i_ino | ((unsigned long) sb / L1_CACHE_BYTES);".
> ... I believe this is a
> slip-up, because you should NEVER use bitwise-or in a hash
> formula. This creates a slanted distribution, and depending on
> the address of the superblock block, can cause severe
> inefficiency in the code.
> Just replacing the | with ^ imroves hash-table efficiency
> noticeably,...

Then maybe the attached patch is what you want? This also replaces
`+' on the next line with `^' to avoid slanted distribution.

------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/



-
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 : Wed Jan 31 2001 - 21:00:38 EST