git: kernel - Fix vkernel race in host

Matthew Dillon dillon at
Sat Jan 28 10:34:11 PST 2017

commit 98e80c6197a3c9407427208478cd1c813ff5f1ec
Author: Matthew Dillon <dillon at>
Date:   Sat Jan 28 10:30:53 2017 -0800

    kernel - Fix vkernel race in host
    * Obtaining a cache_ref before setting the DELETED flag deals with any
      drop race on cache_refs from another thread.
      This is actually quite elegant when done correctly.  The VKE_REF_DELETED
      on ve->refs determines when the ve has been destroyed, while
      ve->cache_refs determines when to kfree() the ve.  Acquiring an extra
      cache_ref before setting DELETED interlocks the two fields for last-drop

Summary of changes:
 sys/vm/vm_vmspace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list