Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115205199
D42266.id129066.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
910 B
Referenced Files
None
Subscribers
None
D42266.id129066.diff
View Options
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -568,9 +568,16 @@
if (tid0 != THREAD0_TID)
panic("tid0 %d != %d\n", tid0, THREAD0_TID);
+ /*
+ * Thread structures are specially aligned so that (at least) the
+ * 5 lower bits of a pointer to 'struct thead' must be 0. These are
+ * used by synchronization primitives to store flags in pointers to
+ * thread structures (lockmgr, rwlock, and sx use the whole 5 bits,
+ * rmlock indirectly by relying on sx, mtx (non-spin) relies on 3 bits).
+ */
thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(),
thread_ctor, thread_dtor, thread_init, thread_fini,
- 32 - 1, UMA_ZONE_NOFREE);
+ UMA_ALIGN_CACHE_AND_MASK(32 - 1), UMA_ZONE_NOFREE);
tidhashtbl = hashinit(maxproc / 2, M_TIDHASH, &tidhash);
tidhashlock = (tidhash + 1) / 64;
if (tidhashlock > 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 22, 10:17 AM (4 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17703027
Default Alt Text
D42266.id129066.diff (910 B)
Attached To
Mode
D42266: Ensure 'struct thread' is aligned to a cache line
Attached
Detach File
Event Timeline
Log In to Comment