diff options
author | alc <alc@FreeBSD.org> | 2003-06-13 06:17:42 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-06-13 06:17:42 +0000 |
commit | d2198cef89d5fa9da656125ae26206eaa7fefdb9 (patch) | |
tree | f703091b3732147dff7dffe9886d43c7c4a48029 | |
parent | d66a37a0f2941403e0d02a5cb82f14bdb07338cc (diff) | |
download | FreeBSD-src-d2198cef89d5fa9da656125ae26206eaa7fefdb9.zip FreeBSD-src-d2198cef89d5fa9da656125ae26206eaa7fefdb9.tar.gz |
Extend the scope of the vm object lock in swp_pager_async_iodone() to cover
a vm_page_free().
-rw-r--r-- | sys/vm/swap_pager.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index e1880f8..67ec883 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1485,8 +1485,6 @@ swp_pager_async_iodone(bp) /* * set object, raise to splvm(). */ - if (bp->b_npages) - object = bp->b_pages[0]->object; s = splvm(); /* @@ -1494,6 +1492,10 @@ swp_pager_async_iodone(bp) */ pmap_qremove((vm_offset_t)bp->b_data, bp->b_npages); + if (bp->b_npages) { + object = bp->b_pages[0]->object; + VM_OBJECT_LOCK(object); + } vm_page_lock_queues(); /* * cleanup pages. If an error occurs writing to swap, we are in @@ -1620,7 +1622,6 @@ swp_pager_async_iodone(bp) * pip refs on the object. */ if (object != NULL) { - VM_OBJECT_LOCK(object); vm_object_pip_wakeupn(object, bp->b_npages); VM_OBJECT_UNLOCK(object); } |