git: nvmm: Port to DragonFly #20: preemption & critical section

Aaron LI aly at
Tue Jul 20 16:30:19 PDT 2021

commit 0059657bc2079e0533a8ec5814c9f8279e94bd6c
Author: Aaron LI <aly at>
Date:   Sat May 22 21:58:44 2021 +0800

    nvmm: Port to DragonFly #20: preemption & critical section
    In DragonFly, a normal kernel thread will not migrate to another CPU or be
    preempted (except by an interrupt thread), so kpreempt_{disable,enable}()
    are not needed.  However, we can't use critical section as an instead,
    because that would also prevent interrupt/reschedule flags from being
    set, which would be a problem for nvmm_return_needed() that's called from
    vcpu_run() loop.  (credit to Matt Dillon)
    Port nvmm_return_needed() to DragonFly.  But note that the
    *_resched_wanted() functions cannot be used in critical sections, which
    would prevent the relevant flags from being set.  (credit to Matt Dillon)
    Port splhigh()/splx() as critical sections in DragonFly for the moment.
    Don't worry about it unless we have issues with it later.

Summary of changes:
 sys/dev/virtual/nvmm/nvmm_compat.h   | 30 ++++++++++++++++++++++++++++--
 sys/dev/virtual/nvmm/nvmm_internal.h |  2 +-
 2 files changed, 29 insertions(+), 3 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list