From d1ca25be49ab19232d650dd40f52e2dd7567b600 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:19:27 +0000 Subject: [PATCH] thread: pad tid lock On a kernel with other changes this bumps 104-way thread creation/destruction from 0.96 mln ops/s to 1.1 mln ops/s. --- sys/kern/kern_thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 4da09d63010..39fe0ce1235 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -135,7 +135,7 @@ static int thread_unsuspend_one(struct thread *td, struct proc *p, bool boundary); static void thread_free_batched(struct thread *td); -static struct mtx tid_lock; +static __exclusive_cache_line struct mtx tid_lock; static bitstr_t *tid_bitmap; static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash");