git: DragonFly_RELEASE_2_8 kernel - Fix serious issue w/ smp_invltlb(), plus other issues.

Matthew Dillon dillon at
Thu Oct 28 14:23:46 PDT 2010

commit 7402df27b5be0de4f74c3e2b8b5c8327434e8509
Author: Matthew Dillon <dillon at>
Date:   Wed Oct 27 23:55:58 2010 -0700

    kernel - Fix serious issue w/ smp_invltlb(), plus other issues.
    * smp_invltlb() was running asynchronously when it really needs to run
      synchronously.  Generally speaking the asynchronous ipi did in fact work
      pretty well but it still presents a 1uS window of opportunity which
      bypasses normal write ordering safeties.
      Run smp_invltlb() synchronously.
    * Fixing the above lea to the discovery of an ACPI issue.  The ACPI
      cpu idle halt code, at least on the gigabyte phenom x 6 I've been
      testing with, can cause IPIs to be lost.  Not just delayed, straight
      out lost.  Gone.  Poof.  It doesn't matter whether the IPI is a
      broadcast IPI or a directed IPI, it can still get lost.
      This was particularly noticeable when I fixed smp_invltlb() and my
      test box started locking up due to a random cpu sometimes not receiving
      the Xinvltlb IPI, and it is quite possible that this issue was also
      responsible for the random seg-faults we would sometimes get on 64-bit
      For now the acpi halt code has been disabled.  It can be enabled with
      sysctl machdep.cpu_idle_hlt=2 if you want to risk it.
    * Use doreti_syscall_ret and doreti_iret in several cases that were
      previously popping the interrupt frame and iret'ing manually.  This
      is operationally equivalent.
    * Add a missing "sti" in the idle loop.  Usually the cpu_idle_hook()
      deals with this but there are some alternative paths which might not,
      potentially causing interrupts to be delayed unnecessarily.
      At worst the idle thread has an extra sti in it.
    * Add v_smpinvltlb to struct vmmeter, plus some reserved slots for
      future expansion.
    * Adjust vmstat -s to report smpinvltlb's.

Summary of changes:
 sys/cpu/i386/include/cpufunc.h         |    1 +
 sys/cpu/x86_64/include/cpufunc.h       |    1 +
 sys/platform/pc32/apic/apic_vector.s   |   22 +++++-----
 sys/platform/pc32/i386/machdep.c       |   28 ++++++++++---
 sys/platform/pc32/i386/mp_machdep.c    |   55 ++++++++++++++++++++-----
 sys/platform/pc32/include/globaldata.h |    1 +
 sys/platform/pc64/apic/apic_vector.s   |   26 ++++++------
 sys/platform/pc64/include/globaldata.h |    1 +
 sys/platform/pc64/x86_64/machdep.c     |   28 ++++++++++---
 sys/platform/pc64/x86_64/mp_machdep.c  |   70 +++++++++++++++++++++++++++-----
 sys/platform/pc64/x86_64/pmap.c        |    6 +--
 sys/sys/vmmeter.h                      |   11 +++++-
 usr.bin/vmstat/vmstat.c                |    1 +
 13 files changed, 187 insertions(+), 64 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list