kernel - Misc adjustments used by the vkernel and VMM, misc optimizations
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 14 Sep 2013 02:02:55 +0000 (19:02 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 14 Sep 2013 02:02:55 +0000 (19:02 -0700)
commit8cee56f46a3ba3b169e5c0b4716c457bc9d03164
treefd9fe1dbdc169df821de686f25de4b0aacf70ee4
parent86689d3d94df777c02db785df7b4cc6d2fac8ef8
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.
sys/kern/kern_proc.c
sys/kern/kern_sig.c
sys/kern/kern_spinlock.c
sys/kern/lwkt_ipiq.c
sys/kern/lwkt_thread.c
sys/kern/usched_dfly.c
sys/sys/thread.h