- Use a RISC-style copyin optimised for pulling system call arguments.
In tests I have done on Intel hardware this removes any measurable
advantage to passing the syscall arguments in registers.
- Make structures CPU-cache friendly, as suggested and explained
by Andrew Doran. CACHE_LINE_SIZE definition is invented.
- Use current CPU if NULL is passed to the workqueue_enqueue().
- Implemented MI CPU index, which could be used as an index of array.
Removed linked-lists usage for work queues.
The roundup2() function avoids division, but works only with power of 2.
Reviewed by: <ad>, <yamt>, <tech-kern>
detach/join.
- Make mutex acquire spin for a short time, as done with spinlocks.
- Make the number of spins controllable with the env var PTHREAD_NSPINS.
- Reduce the amount of time that libpthread internal spinlocks are held.
- Rely more on the barrier effects of park/unpark to avoid taking spinlocks.
- Simplify the locking around pthreads and the global queues.
- Align per-thread sync data on a 128 byte boundary.
- Offset thread stacks by a small amount to try and reduce cache thrash.
It was previously possible to round up one sector length if the start block
were not properly aligned.
Resolves PR kern/36716. This may also fix the following reported issues
on port-sgimips:
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0000.htmlhttp://mail-index.netbsd.org/port-sgimips/2005/09/14/0000.html
While here, be sure to put back allocated bufs, which previously appear
to have been leaked. Further, remove the dead write bounce code which never
got executed anyway.
No complaints on tech-kern.
do not leak file descriptors when sending a datagram with SCM_RIGHTS
fails. Patch from Gary Thorpe, based on changes in FreeBSD and work
from Christian Biere.