Re: 2.4.X inode cache bug

Quim K Holland (qkholland@my-deja.com)
Tue, 30 Jan 2001 23:01:49 -0800


This is a multi-part message in MIME format...

------------=_980924509-5642-0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary

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/

------------=_980924509-5642-0
Content-Type: application/octet-stream; name="jukka.patch"
Content-Disposition: inline; filename="jukka.patch"
Content-Transfer-Encoding: base64

LS0tIDIuNC4xL2ZzL2lub2RlLmMJTW9uIEphbiAxNSAxODoyMDoxNCAyMDAx
CisrKyAyLjQuMS9mcy9pbm9kZS5jCVR1ZSBKYW4gMzAgMjI6NTQ6NDIgMjAw
MQpAQCAtNzI4LDggKzcyOCw4IEBACiAKIHN0YXRpYyBpbmxpbmUgdW5zaWdu
ZWQgbG9uZyBoYXNoKHN0cnVjdCBzdXBlcl9ibG9jayAqc2IsIHVuc2lnbmVk
IGxvbmcgaV9pbm8pCiB7Ci0JdW5zaWduZWQgbG9uZyB0bXAgPSBpX2lubyB8
ICgodW5zaWduZWQgbG9uZykgc2IgLyBMMV9DQUNIRV9CWVRFUyk7Ci0JdG1w
ID0gdG1wICsgKHRtcCA+PiBJX0hBU0hCSVRTKSArICh0bXAgPj4gSV9IQVNI
QklUUyoyKTsKKwl1bnNpZ25lZCBsb25nIHRtcCA9IGlfaW5vIF4gKCh1bnNp
Z25lZCBsb25nKSBzYiAvIEwxX0NBQ0hFX0JZVEVTKTsKKwl0bXAgPSB0bXAg
XiAodG1wID4+IElfSEFTSEJJVFMpIF4gKHRtcCA+PiBJX0hBU0hCSVRTKjIp
OwogCXJldHVybiB0bXAgJiBJX0hBU0hNQVNLOwogfQo=

------------=_980924509-5642-0--
-
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/