diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index df027acd8003..0224e157b6e0 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -134,9 +134,7 @@ ncl_getpages(struct vop_getpages_args *ap) for (i = 0; i < npages; ++i) { if (i != ap->a_reqpage) { vm_page_lock(pages[i]); - vm_page_lock_queues(); vm_page_free(pages[i]); - vm_page_unlock_queues(); vm_page_unlock(pages[i]); } } @@ -177,9 +175,7 @@ ncl_getpages(struct vop_getpages_args *ap) for (i = 0; i < npages; ++i) { if (i != ap->a_reqpage) { vm_page_lock(pages[i]); - vm_page_lock_queues(); vm_page_free(pages[i]); - vm_page_unlock_queues(); vm_page_unlock(pages[i]); } } diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c index 0bb996fb3b33..125201408adb 100644 --- a/sys/fs/nwfs/nwfs_io.c +++ b/sys/fs/nwfs/nwfs_io.c @@ -431,9 +431,7 @@ nwfs_getpages(ap) for (i = 0; i < npages; i++) { if (ap->a_reqpage != i) { vm_page_lock(pages[i]); - vm_page_lock_queues(); vm_page_free(pages[i]); - vm_page_unlock_queues(); vm_page_unlock(pages[i]); } } diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c index c47fb1bcfe4a..1ffcde9fb803 100644 --- a/sys/fs/smbfs/smbfs_io.c +++ b/sys/fs/smbfs/smbfs_io.c @@ -443,9 +443,7 @@ smbfs_getpages(ap) for (i = 0; i < npages; ++i) { if (i != reqpage) { vm_page_lock(pages[i]); - vm_page_lock_queues(); vm_page_free(pages[i]); - vm_page_unlock_queues(); vm_page_unlock(pages[i]); } } @@ -484,9 +482,7 @@ smbfs_getpages(ap) for (i = 0; i < npages; i++) { if (reqpage != i) { vm_page_lock(pages[i]); - vm_page_lock_queues(); vm_page_free(pages[i]); - vm_page_unlock_queues(); vm_page_unlock(pages[i]); } } diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 0ec9817140da..fc87d6394040 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -948,11 +948,9 @@ exec_map_first_page(imgp) rv = vm_pager_get_pages(object, ma, initial_pagein, 0); ma[0] = vm_page_lookup(object, 0); if ((rv != VM_PAGER_OK) || (ma[0] == NULL)) { - if (ma[0]) { + if (ma[0] != NULL) { vm_page_lock(ma[0]); - vm_page_lock_queues(); vm_page_free(ma[0]); - vm_page_unlock_queues(); vm_page_unlock(ma[0]); } VM_OBJECT_UNLOCK(object); diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index c93d677eaddb..37da34b8cce3 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -132,9 +132,7 @@ nfs_getpages(struct vop_getpages_args *ap) for (i = 0; i < npages; ++i) { if (i != ap->a_reqpage) { vm_page_lock(pages[i]); - vm_page_lock_queues(); vm_page_free(pages[i]); - vm_page_unlock_queues(); vm_page_unlock(pages[i]); } } @@ -175,9 +173,7 @@ nfs_getpages(struct vop_getpages_args *ap) for (i = 0; i < npages; ++i) { if (i != ap->a_reqpage) { vm_page_lock(pages[i]); - vm_page_lock_queues(); vm_page_free(pages[i]); - vm_page_unlock_queues(); vm_page_unlock(pages[i]); } } diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index a2fee4ecb41f..96d0c7a3e8da 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -850,9 +850,7 @@ ffs_getpages(ap) for (i = 0; i < pcount; i++) { if (i != ap->a_reqpage) { vm_page_lock(ap->a_m[i]); - vm_page_lock_queues(); vm_page_free(ap->a_m[i]); - vm_page_unlock_queues(); vm_page_unlock(ap->a_m[i]); } } diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 996f740c0eed..7d8d3611b377 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -255,9 +255,7 @@ dev_pager_getpages(object, m, count, reqpage) for (i = 0; i < count; i++) { if (i != reqpage) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } } @@ -272,9 +270,7 @@ dev_pager_getpages(object, m, count, reqpage) TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist, page, pageq); for (i = 0; i < count; i++) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } vm_page_insert(page, object, offset); diff --git a/sys/vm/sg_pager.c b/sys/vm/sg_pager.c index 845401a4bbdd..a7b373647a57 100644 --- a/sys/vm/sg_pager.c +++ b/sys/vm/sg_pager.c @@ -200,9 +200,7 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) /* Free the original pages and insert this fake page into the object. */ for (i = 0; i < count; i++) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } vm_page_insert(page, object, offset); diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 2978f7f3a82e..ae1ee290707f 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -164,9 +164,7 @@ unlock_and_deallocate(struct faultstate *fs) if (fs->object != fs->first_object) { VM_OBJECT_LOCK(fs->first_object); vm_page_lock(fs->first_m); - vm_page_lock_queues(); vm_page_free(fs->first_m); - vm_page_unlock_queues(); vm_page_unlock(fs->first_m); vm_object_pip_wakeup(fs->first_object); VM_OBJECT_UNLOCK(fs->first_object); @@ -348,9 +346,7 @@ RetryFault:; if (fs.object != fs.first_object) { VM_OBJECT_LOCK(fs.first_object); vm_page_lock(fs.first_m); - vm_page_lock_queues(); vm_page_free(fs.first_m); - vm_page_unlock_queues(); vm_page_unlock(fs.first_m); vm_object_pip_wakeup(fs.first_object); VM_OBJECT_UNLOCK(fs.first_object); @@ -638,9 +634,7 @@ RetryFault:; if (((fs.map != kernel_map) && (rv == VM_PAGER_ERROR)) || (rv == VM_PAGER_BAD)) { vm_page_lock(fs.m); - vm_page_lock_queues(); vm_page_free(fs.m); - vm_page_unlock_queues(); vm_page_unlock(fs.m); fs.m = NULL; unlock_and_deallocate(&fs); @@ -648,9 +642,7 @@ RetryFault:; } if (fs.object != fs.first_object) { vm_page_lock(fs.m); - vm_page_lock_queues(); vm_page_free(fs.m); - vm_page_unlock_queues(); vm_page_unlock(fs.m); fs.m = NULL; /* @@ -764,13 +756,11 @@ RetryFault:; * We don't chase down the shadow chain */ fs.object == fs.first_object->backing_object) { - vm_page_lock(fs.first_m); - vm_page_lock_queues(); /* * get rid of the unnecessary page */ + vm_page_lock(fs.first_m); vm_page_free(fs.first_m); - vm_page_unlock_queues(); vm_page_unlock(fs.first_m); /* * grab the page and put it into the diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index f86212f02917..0b9d92a1df11 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -258,9 +258,7 @@ vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset) goto out; if (rv != VM_PAGER_OK) { vm_page_lock(m); - vm_page_lock_queues(); vm_page_free(m); - vm_page_unlock_queues(); vm_page_unlock(m); m = NULL; goto out; @@ -437,10 +435,8 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t ks, int pages) if (m == NULL) panic("vm_thread_dispose: kstack already missing?"); vm_page_lock(m); - vm_page_lock_queues(); vm_page_unwire(m, 0); vm_page_free(m); - vm_page_unlock_queues(); vm_page_unlock(m); } VM_OBJECT_UNLOCK(ksobj); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index f8c50bc73a06..3986d142d87b 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2046,9 +2046,7 @@ vm_object_populate(vm_object_t object, vm_pindex_t start, vm_pindex_t end) break; if (rv != VM_PAGER_OK) { vm_page_lock(m); - vm_page_lock_queues(); vm_page_free(m); - vm_page_unlock_queues(); vm_page_unlock(m); break; } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index eb21c60a7c3b..69fd5d101c71 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -725,9 +725,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) for (i = 0; i < count; i++) if (i != reqpage) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } PCPU_INC(cnt.v_vnodein); @@ -740,9 +738,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) for (i = 0; i < count; i++) if (i != reqpage) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } VM_OBJECT_UNLOCK(object); @@ -759,9 +755,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) for (i = 0; i < count; i++) if (i != reqpage) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } VM_OBJECT_UNLOCK(object); @@ -780,9 +774,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) for (i = 0; i < count; i++) if (i != reqpage) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } VM_OBJECT_UNLOCK(object); @@ -795,9 +787,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) for (i = 0; i < count; i++) if (i != reqpage) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } VM_OBJECT_UNLOCK(object); @@ -821,9 +811,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) for (; i < count; i++) if (i != reqpage) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } VM_OBJECT_UNLOCK(object); @@ -840,9 +828,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) (uintmax_t)object->un_pager.vnp.vnp_size); } vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); VM_OBJECT_UNLOCK(object); runend = i + 1; @@ -854,9 +840,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) VM_OBJECT_LOCK(object); for (j = i; j < runend; j++) { vm_page_lock(m[j]); - vm_page_lock_queues(); vm_page_free(m[j]); - vm_page_unlock_queues(); vm_page_unlock(m[j]); } VM_OBJECT_UNLOCK(object); @@ -865,9 +849,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) VM_OBJECT_LOCK(object); for (i = first + runpg; i < count; i++) { vm_page_lock(m[i]); - vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); vm_page_unlock(m[i]); } VM_OBJECT_UNLOCK(object);