[DragonFlyBSD - Bug #3430] (New) pc64 pmap: wired-to-wired PTE replacement loses wire references

sigttou bugtracker-admin at leaf.dragonflybsd.org
Sat Oct 3 08:27:41 PDT 2026


Issue #3430 has been reported by sigttou.

----------------------------------------
Bug #3430: pc64 pmap: wired-to-wired PTE replacement loses wire references
http://bugs.dragonflybsd.org/issues/3430

* Author: sigttou
* Status: New
* Priority: Normal
* Category: Kernel
* Target version: 6.6
* Start date: 2026-10-03
----------------------------------------
pmap_enter() only adds the new wired reference when the old PTE was not wired,
but it always drops the old wired reference. Replacing a wired mapping with
another wired mapping therefore loses a pmap wire count and a vm_page wire count.

This shows up as a panic ("vm_page_unwire: invalid wire count: 0") after an
mlock()ed mapping has its protection changed to read-only and back, and as a
negative wired count ("fatal pmap problem ... wirecnt=-6") when a vkernel exits.

Fix: count the new wired reference whenever the new PTE is wired, matching the
unconditional drop of the old one. For an already-wired same-page replacement,
which may be soft-busied, use vm_page_wire_quick() instead of vm_page_wire().
Skip fictitious pages, which have no physical wire count.

---Files--------------------------------
0001-pmap-wired-replacement.patch (1.36 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list