aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TypePrinter.cpp
diff options
context:
space:
mode:
authorNick Price <nprice@FreeBSD.org>2026-08-31 23:47:12 +0000
committerNick Price <nprice@FreeBSD.org>2026-08-31 23:47:24 +0000
commitee44a57e34a8812b4641d5c9202255ea7883764d (patch)
tree79a81c7fd93d8a4860c73d8f92831e69a4b856e4 /lib/AST/TypePrinter.cpp
parent742c5498aca9a9a31a68eb9d5888edf36b7034dd (diff)
umtx: use a distribution-fair multiplier for the chain hashHEADmain
umtxq_hash() multiplies the key by 0x9E370001 and keeps the high bits. That constant is 0x9E37 * 2^16 + 1, so it degenerates for keys whose spacing carries trailing zero bits: at a 64 KiB stride it puts 128 of 512 parked waiters onto a single chain mutex, and at 16 KiB and up it uses only a handful of the 512 chains. Base-system consumers never hit this because libthr places its own wait words 128 bytes apart, but a Linux-ABI runtime waiting on addresses it allocates itself lands squarely on the floor. Switch to 0x61C88647, which leaves at most 3 waiters per chain at the same stride; Linux made this exact change in 2016, after judging the sparse constants "actively bad for hashing". Approved by: adrian (mentor) Reviewed by: kib, adrian, emaste Differential Revision: https://reviews.freebsd.org/D58337 Signed-off-by: Nick Price <nprice@FreeBSD.org>
Diffstat (limited to 'lib/AST/TypePrinter.cpp')
0 files changed, 0 insertions, 0 deletions