kernel - Misc adjustments used by the vkernel and VMM, misc optimizations
* This section committed separately because it is basically independent
of VMM.
* Improve pfind(). Don't get proc_token if the process being looked up
is the current process.
* Improve kern_kill(). Do not obtain proc_token any more. p->p_token
is sufficient and the process group has its own lock now.
* Call pthread_yield() when spinning on various things.
x Spinlocks
x Tokens (spinning in lwkt_switch)
x cpusync (ipiq)
* Rewrite sched_yield() -> dfly_yield(). dfly_yield() will
unconditionally round-robin the LWP, ignoring estcpu. It isn't
perfect but it works fairly well.
The dfly scheduler will also no longer attempt to migrate threads
across cpus when handling yields. They migrate normally in all
other circumstances.
This fixes situations where the vkernel is spinning waiting for multiple
events from other cpus and in particular when it is doing a global IPI
for pmap synchronization of the kernel_pmap.