git: kernel - Improve SPINLOCK, acpi_timer performance under qemu/kvm/VMs

Matthew Dillon dillon at
Fri Apr 13 13:51:42 PDT 2018

commit e3e00568dc4cc38dbb21e301e877a1da9d734bea
Author: Matthew Dillon <dillon at>
Date:   Thu Apr 12 21:21:33 2018 -0700

    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_

Summary of changes:
 sys/dev/acpica/acpi_timer.c      | 113 ++++++++++++++++++++++++++++++++-------
 sys/platform/pc64/include/lock.h |  14 +++--
 2 files changed, 104 insertions(+), 23 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list