git: kernel - Fix i386 wire_count panics
dillon at crater.dragonflybsd.org
Wed Sep 26 10:50:08 PDT 2012
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Wed Sep 26 10:36:13 2012 -0700
kernel - Fix i386 wire_count panics
* Tracked down to a situation where a pmap structure is being dtor'd by
the objcache simultaniously with a vm_page_protect() operation on
a page table page's vm_page_t.
(1) vm_page_protect() begins running, finds page table page to remove,
removes the related pv_entry, but then gets stuck waiting for the
pmap->pm_pteobj (vm_object token).
(2) Exit on another thread simultaniously removes all remaining VM
pages from the pmap. However, due to #(1), there is still an
active page table page in pmap->pm_pteobj that the exit code has
no visibility to.
(3) The related pmap is then dtor'd due to heavy fork/exec/exit load
on the system. The VM page is still present, vm_page_protect()
is still stuck on the token (or hasn't gotten cpu back).
(4) Nominal vm_object_terminate() destroys the page table page.
(5) vm_page_protect() unblocks and tries to destroy the page.
* This fix places a barrier between the normal process exit code and the
dtor which will block while a vm_page_protect() is active on the pmap.
* This time for sure, but if not we still know that the problem is related
to this exit race.
Summary of changes:
sys/platform/pc32/i386/pmap.c | 72 ++++++++++++++++++++++++++++++++------
sys/platform/pc64/x86_64/pmap.c | 10 -----
sys/vm/pmap.h | 1 -
3 files changed, 60 insertions(+), 23 deletions(-)
DragonFly BSD source repository
More information about the Commits