Fix a bug in umtx_sleep(). This function sleeps on the mutex's physical
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 14 Apr 2008 20:00:29 +0000 (20:00 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 14 Apr 2008 20:00:29 +0000 (20:00 +0000)
commit10192bae442ad33e063cbe1ef783b764e4a0a71d
tree8cc56f8422edc16ed98e2b9dbe7000bd36b0f2b5
parent397a32b6c2c4794f2b7be6867879eca878c59dc7
Fix a bug in umtx_sleep().  This function sleeps on the mutex's physical
address and will get lost if the physical page underlying the VM address is
copied on write.  This case can occur when a threaded program fork()'s.

Introduce a VM page event notification mechanism and use it to wake-up
the umtx_sleep() if the underlying page takes a COW fault.

Reported-by: Jordan Gordeev <jgordeev@dir.bg>,
     "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
sys/kern/kern_umtx.c
sys/vm/vm_fault.c
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_page2.h