git: kernel - pc64 - Fix pv_free() race and add assertions

Matthew Dillon dillon at
Sun Oct 6 16:42:06 PDT 2013

commit 8e2efb11e5cbf92f0ed06258cbd1f6bfc684e5c8
Author: Matthew Dillon <dillon at>
Date:   Sun Oct 6 16:34:53 2013 -0700

    kernel - pc64 - Fix pv_free() race and add assertions
    * Continued work trying to fix the bad *ptep ... panics.  Previous commits
      did not do the job.  It is still unknown whether this one completely fixes
      the panic.
    * The pmap pv_entry API was allowing pv_entry's to be retained with 0 refs
      and then doing a separate check for pv_pmap == NULL to determine if the
      pv_entry could be freed or not.  This resulted in a SMP race where multiple
      threads could pv_free() the same pv_entry.
    * Change the code to supply an addition ref for pv_pmap != NULL and use the
      1->0 transition to deterministically conditionalize the pv_free().
    * Change the shortcuts in pv_hold_try() and pv_drop() to use the new
    * Add some additional assertions and a generation count to try to check bugs.

Summary of changes:
 sys/platform/pc64/include/pmap.h |   2 +-
 sys/platform/pc64/x86_64/pmap.c  | 263 ++++++++++++++++++++++++++++++---------
 sys/vm/vm_fault.c                |   1 +
 3 files changed, 204 insertions(+), 62 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list