DF-5146 / run.2.log
=== userspace arithmetic proof === hash_long(key, 12) samples (drm map_hash / gem offset_hash): key=0x0000000000000000 -> bucket=0 key=0x9e3779b97f4a7c15 -> bucket=0 key=0x3c6ef372fe94f82a -> bucket=0 key=0xdaa66d2c7ddf743f -> bucket=0 key=0x78dde6e5fd29f054 -> bucket=0 key=0x1715609f7c746c69 -> bucket=0 key=0xb54cda58fbbee87e -> bucket=0 key=0x538454127b096493 -> bucket=0 i386 hash_32(key,12) max bucket = 22 (table has 4096 buckets) tested=6400000 zero64=6400000 RESULT: hash_long(key,bits)==0 for ALL 6400000 inputs with bits in [1,32] -- 64-bit drm hash tables collapse to bucket 0 === kernel baseline (stock code) === HTCOLLAPSE: order=12 table=4096 buckets, insert 8192 sequential keys (alloc_unr style, drm_gem.c:576) HTCOLLAPSE: per-1024-insert wall time (us): 596 2014 3578 5019 7141 8217 9599 11231 HTCOLLAPSE: nonempty_buckets=1/4096 max_chain=8192 total_items=8192 errors=0 HTCOLLAPSE: find(key=1)=0 (found) HTCOLLAPSE: find(key=8192)=0 (found) HTCOLLAPSE: find(key=0xdead0000)=-22 (absent (ok)) HTCOLLAPSE: dup-insert=-22 (rejected (ok)) HTCOLLAPSE: remove/reinsert=0 (0=ok) HTCOLLAPSE: VERDICT errors=0 nonempty_buckets=1 max_chain=8192 => hash_long collapse CONFIRMED in-kernel === kernel fixed (fixinc/linux/hash.h) === HTCOLLAPSE: order=12 table=4096 buckets, insert 8192 sequential keys (alloc_unr style, drm_gem.c:576) HTCOLLAPSE: per-1024-insert wall time (us): 28 18 17 18 18 18 18 18 HTCOLLAPSE: nonempty_buckets=4096/4096 max_chain=2 total_items=8192 errors=0 HTCOLLAPSE: find(key=1)=0 (found) HTCOLLAPSE: find(key=8192)=0 (found) HTCOLLAPSE: find(key=0xdead0000)=-22 (absent (ok)) HTCOLLAPSE: dup-insert=-22 (rejected (ok)) HTCOLLAPSE: remove/reinsert=0 (0=ok) HTCOLLAPSE: VERDICT errors=0 nonempty_buckets=4096 max_chain=2 => hash distributed normally (fixed header in effect) RUN-DONE