git: pc64: balance wired PTE replacement and hard-busy wired refaults

Aaron LI aly at crater.dragonflybsd.org
Mon Oct 5 04:08:18 PDT 2026


commit 2b3839b175cf8eeadc0064c62f02e207bcf36111
Author: David Bidner <david at crap.solutions>
Date:   Sun Oct 4 07:47:25 2026 +0200

    pc64: balance wired PTE replacement and hard-busy wired refaults
    
    pmap_enter drops the previous wired mapping, so account for the new
    wired mapping even if the old PTE was wired. Otherwise protection
    changes can underflow the pmap and vm_page wire counts.
    
    Use vm_page_wire_quick for an already-wired same-page replacement, which
    may be soft-busied. Skip fictitious pages, which have no physical wiring
    count.
    
    The old physical wire is released by pmap_removed_pte, and the old pmap
    wire count is dropped separately in pmap_enter. Do not add another unwire.
    
    Also reject FW_WIRED in vm_fault_bypass. An ordinary fault on a wired entry
    may need to establish a new wire after its PTE was invalidated, so the
    soft-busy shortcut cannot assume an old wired reference still exists.
    A shared file mapped twice, mlock on one alias, MADV_INVAL on that alias
    and a subsequent read otherwise panics in vm_page_wire. The normal
    hard-busy fault path handles this case.
    
    This is a follow-up fix to commits 3d7bc7325a7d08499e36389668c21eac68ccca4f
    and 8ec33efba7563efab10f0d90b5684480d94daf0a.
    
    Reviewed-by: dillon
    Bug: https://bugs.dragonflybsd.org/issues/3430

Summary of changes:
 sys/platform/pc64/x86_64/pmap.c | 12 ++++++++++--
 sys/vm/vm_fault.c               |  3 ++-
 2 files changed, 12 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2b3839b175cf8eeadc0064c62f02e207bcf36111


-- 
DragonFly BSD source repository


More information about the Commits mailing list