Close an interrupt race between vm_page_lookup() and (typically) a
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 13 May 2004 17:40:19 +0000 (17:40 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 13 May 2004 17:40:19 +0000 (17:40 +0000)
commit06ecca5a02c2946b0e2287481933f74e3cf670b5
tree41220fee9819ec19f88f833f750e7aabc401a9d7
parent97989fd8d874265133d80c7dbaf4403f85dba6a8
Close an interrupt race between vm_page_lookup() and (typically) a
vm_page_sleep_busy() check by using the correct spl protection.
An interrupt can occur inbetween the two operations and unbusy/free
the page in question, causing the busy check to fail and for the code
to fall through and then operate on a page that may have been freed
and possibly even reused.   Also note that vm_page_grab() had the same
issue between the lookup, busy check, and vm_page_busy() call.

Close an interrupt race when scanning a VM object's memq.  Interrupts
can free pages, removing them from memq, which interferes with memq scans
and can cause a page unassociated with the object to be processed as if it
were associated with the object.

Calls to vm_page_hold() and vm_page_unhold() require spl protection.

Rename the passed socket descriptor argument in sendfile() to make the
code more readable.

Fix several serious bugs in procfs_rwmem().  In particular, force it to
block if a page is busy and then retry.

Get rid of vm_pager_map_pag() and vm_pager_unmap_page(), make the functions
that used to use these routines use SFBUF's instead.

Get rid of the (userland?) 4MB page mapping feature in pmap_object_init_pt()
for now.  The code appears to not track the page directory properly and
could result in a non-zero page being freed as PG_ZERO.

This commit also includes updated code comments and some additional
non-operational code cleanups.
19 files changed:
sys/i386/i386/pmap.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_xio.c
sys/kern/uipc_syscalls.c
sys/kern/vfs_bio.c
sys/platform/pc32/i386/pmap.c
sys/sys/xio.h
sys/vfs/procfs/procfs_mem.c
sys/vm/vm_fault.c
sys/vm/vm_map.c
sys/vm/vm_mmap.c
sys/vm/vm_object.c
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_pageout.c
sys/vm/vm_pager.c
sys/vm/vm_pager.h
sys/vm/vnode_pager.c