Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168758158
D58337.id184127.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
750 B
Referenced Files
None
Subscribers
None
D58337.id184127.diff
View Options
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -113,7 +113,11 @@
(td)->td_user_pri <= PRI_MAX_TIMESHARE) ?\
PRI_MAX_TIMESHARE : (td)->td_user_pri)
-#define GOLDEN_RATIO_PRIME 2654404609U
+/*
+ * Linux's fair multiplier, which replaced the bit-sparse 0x9E370001
+ * that collapses for keys an allocator arena apart.
+ */
+#define GOLDEN_RATIO_32 1640531527U
#ifndef UMTX_CHAINS
#define UMTX_CHAINS 512
#endif
@@ -380,7 +384,7 @@
unsigned n;
n = (uintptr_t)key->info.both.a + key->info.both.b;
- key->hash = ((n * GOLDEN_RATIO_PRIME) >> UMTX_SHIFTS) % UMTX_CHAINS;
+ key->hash = ((n * GOLDEN_RATIO_32) >> UMTX_SHIFTS) % UMTX_CHAINS;
}
struct umtxq_chain *
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 31, 12:20 AM (16 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36858627
Default Alt Text
D58337.id184127.diff (750 B)
Attached To
Mode
D58337: umtx: use a distribution-fair multiplier for the chain hash
Attached
Detach File
Event Timeline
Log In to Comment