git: kernel - Fix MP system call performance regression

Matthew Dillon dillon at
Fri Dec 10 00:01:39 PST 2010

commit 911d4144e391f5518957ca6012034414c8226203
Author: Matthew Dillon <dillon at>
Date:   Thu Dec 9 23:53:44 2010 -0800

    kernel - Fix MP system call performance regression
    * The userland scheduler was unconditionally calling lwkt_switch()
      via userexit() (i.e. on every system call), creating unnecessary
      overhead and possibly also triggering a bsd4 scheduler event
      requiring a common spinlock.
    * Rearrange the code slightly to reduce instances where lwkt_switch()
      is called.  We want to try to keep instances where a higher priority
      LWKT thread is potentially runnable or when the LWKT fairq accumulator
      for the current thread has been exhausted.
    * This removes system call overhead multiplication on MP systems.  For
      example, on a 48-core box system call overhead when all 48 cpus are
      busy doing getuid() loops went from 10uS back down to 270nS (which
      is near the single-cpu test results).

Summary of changes:
 sys/kern/usched_bsd4.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list