kernel - Attempt to fix i386 wire_count panic
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 Aug 2012 05:15:47 +0000 (22:15 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 Aug 2012 05:15:47 +0000 (22:15 -0700)
commit2bb9cc6fdf20935fe2e3dfbfedc4eb353034b935
tree824be37af4ca1ef01d3ced171323faca6264746c
parent055b799743a8f3394913e8ec434bc12d3100e3c3
kernel - Attempt to fix i386 wire_count panic

* Finally found what could be the issue.  get_pv_entry() calls zalloc()
  which can fall through to zget() which obtains a zalloc-related LWKT
  token.

  This can temporarily break the vm_token and allow another thread to get
  in and change the pmap pte entry out from under a pmap_enter(), causing
  the pmap_enter() to potentially remove an extra wire_count from the
  page table page.

* Fix by pre-allocating the pv entry, taking it out of the critical path,
  and adjusting a few other bits of code to test the *pte closer to
  the code which replaces it for the purposes of adjusting the wire_count.
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/include/globaldata.h