kernel - extend cpus past 64 - fixes and adjustments
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 6 Jul 2014 19:27:04 +0000 (12:27 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 6 Jul 2014 19:27:04 +0000 (12:27 -0700)
commit1997b4c272782aad27f0d0387f9189ed1e1befbd
treeab1cc2844fe7857d03945b23667eb2637fef941e
parent20e194b60cf385a15d6431fc4c9bb1c2b885640c
kernel - extend cpus past 64 - fixes and adjustments

* Reorder the SMP cpu boot code to remove a great deal of lock contention.
  The APs must still loop waiting for the BSP to adjust the stage, but
  they no longer need to hold a token or spinlock so startup under emulation
  is considerably faster.

* Do not initialize our systimer periodics on each target cpu from the
  idle thread bootstrap.  Previously with the MP lock held the locks acquired
  during this initialization were serialized and could not block.  Now
  that cpu startup runs mostly concurrently, that is no longer the
  case.

  Instead, systimer periodics are handled by process 0 as a post-smp-startup
  call.

* statclock() now uses sys_cputimer() directly to calculate the delta time.

* The TSC is now implemented as sys_cputimer before any systimer periodics
  (particularly statclock()) are set-up, allowing the system to take control
  away from the i8254 earlier.

* Clean up struct lwkt_ipiq.  Remove the 'lwkt_ipiq' typedef.  Calculate
  allocation sizes separately.

* Add a new loader.conf tunable, hw.tsc_cputimer_force.  If set to 1 and
  a TSC is present, the system will force invariant and mpsync operation
  and always use the TSC as the cputimer (primarily useful for qemu).

* Remove unnecessary kmem_alloc() of the globaldata structure.  We are
  using a static array now.  This access was wasting memory for a long
  time.

* Make the boot stack bigger for the APs.
sys/kern/kern_clock.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc64/isa/clock.c
sys/platform/pc64/x86_64/machdep.c
sys/platform/pc64/x86_64/mp_machdep.c
sys/platform/vkernel/i386/mp.c
sys/platform/vkernel64/x86_64/mp.c
sys/sys/globaldata.h
sys/sys/kernel.h
sys/sys/thread.h