Don't call pool_put(9) while holding a mutex.  Instead collect pv entries in a list and put them back into the pool after releasing the mutex.  This prevents a lock ordering problem between the per-pmap mutexes and the kernel lock that arises because pool_put(9) may grab the kernel lock when it decides to free a pool page.
Don't call pool_put(9) while holding a mutex.  Instead collect pv entries in
a list and put them back into the pool after releasing the mutex.  This
prevents a lock ordering problem between the per-pmap mutexes and the kernel
lock that arises because pool_put(9) may grab the kernel lock when it decides
to free a pool page.

This seems to make the i386 pmap mpsafe enough to run the reaper without
holding the kernel lock.

ok sthen@ (who helped me a lot debugging this)

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars