kernel - Improve SPINLOCK, acpi_timer performance under qemu/kvm/VMs
commite3e00568dc4cc38dbb21e301e877a1da9d734bea
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 13 Apr 2018 04:21:33 +0000 (12 21:21 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 13 Apr 2018 20:51:20 +0000 (13 13:51 -0700)
treeeaa5e00b93c46fa7c4c35ec9accff13a5205fffa
parent773895af1cc82422ec936a70e42dc96512c9aead
kernel - Improve SPINLOCK, acpi_timer performance under qemu/kvm/VMs

* Improve acpi_timer 24-bit performance by reducing use of clock_lock().

* Integrate a delta test into acpi_cputimer.base and remove the
  out-of-band tracking globals.  We can query the timer and calculate
  the return value for deltas less than 1/16 full-range.  Beyond
  that range we need to get the clock_lock() to calculate the high
  24 bits safely and update acpi_cputimer.base.

  On SMP systems, cpu #1 will update acpi_cputimer.base more
  frequently, reducing the chance that multiple cpus will need the
  clock_lock() at the same time.

* Refactor the safe24 code to make it easier to use.

* Improve the regressive SPINLOCK assembly macro, bringing it up to
  modern performance levels.  This fixes unnecessary cache ping-ponging
  during contention.

Suggested-by: mjg_
sys/dev/acpica/acpi_timer.c
sys/platform/pc64/include/lock.h