The lock is top of the profile when applied to kernel with other patches (will post later):
294846572 (spin mutex:callout) 1832520 (sleep mutex:TID lock)
disappears with the patch. bumps thread creation/destruction rate 2 -> 3 mln ops/s with 104 workers doing it.
commit 885ad80eaa83261a32815a4f5ec094d35cd5b620 Author: Mateusz Guzik <mjg@FreeBSD.org> Date: Thu Aug 25 22:42:42 2022 +0000 thread: use callout_init_cpu(..., curcpu) Sorts out callout lock contention during heavy thread creation/destruction test. Reviewed by: Differential Revision: commit fdd578e33ad1be7410ad5384b0e22ab351fb0803 Author: Mateusz Guzik <mjg@FreeBSD.org> Date: Thu Aug 25 22:42:08 2022 +0000 callout: add callout_init_cpu Reviewed by: Differential Revision: