svn commit: r207728 - in head/sys: fs/nfsclient fs/nwfs fs/smbfs
kern nfsclient ufs/ffs vm
Alan Cox
alc at FreeBSD.org
Thu May 6 18:58:33 UTC 2010
Author: alc
Date: Thu May 6 18:58:32 2010
New Revision: 207728
URL: http://svn.freebsd.org/changeset/base/207728
Log:
Eliminate page queues locking around most calls to vm_page_free().
Modified:
head/sys/fs/nfsclient/nfs_clbio.c
head/sys/fs/nwfs/nwfs_io.c
head/sys/fs/smbfs/smbfs_io.c
head/sys/kern/kern_exec.c
head/sys/nfsclient/nfs_bio.c
head/sys/ufs/ffs/ffs_vnops.c
head/sys/vm/device_pager.c
head/sys/vm/sg_pager.c
head/sys/vm/vm_fault.c
head/sys/vm/vm_glue.c
head/sys/vm/vm_object.c
head/sys/vm/vnode_pager.c
Modified: head/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clbio.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/fs/nfsclient/nfs_clbio.c Thu May 6 18:58:32 2010 (r207728)
@@ -134,9 +134,7 @@ ncl_getpages(struct vop_getpages_args *a
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 *a
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]);
}
}
Modified: head/sys/fs/nwfs/nwfs_io.c
==============================================================================
--- head/sys/fs/nwfs/nwfs_io.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/fs/nwfs/nwfs_io.c Thu May 6 18:58:32 2010 (r207728)
@@ -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]);
}
}
Modified: head/sys/fs/smbfs/smbfs_io.c
==============================================================================
--- head/sys/fs/smbfs/smbfs_io.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/fs/smbfs/smbfs_io.c Thu May 6 18:58:32 2010 (r207728)
@@ -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]);
}
}
Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/kern/kern_exec.c Thu May 6 18:58:32 2010 (r207728)
@@ -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);
Modified: head/sys/nfsclient/nfs_bio.c
==============================================================================
--- head/sys/nfsclient/nfs_bio.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/nfsclient/nfs_bio.c Thu May 6 18:58:32 2010 (r207728)
@@ -132,9 +132,7 @@ nfs_getpages(struct vop_getpages_args *a
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 *a
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]);
}
}
Modified: head/sys/ufs/ffs/ffs_vnops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vnops.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/ufs/ffs/ffs_vnops.c Thu May 6 18:58:32 2010 (r207728)
@@ -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]);
}
}
Modified: head/sys/vm/device_pager.c
==============================================================================
--- head/sys/vm/device_pager.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/vm/device_pager.c Thu May 6 18:58:32 2010 (r207728)
@@ -255,9 +255,7 @@ dev_pager_getpages(object, m, count, req
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, req
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);
Modified: head/sys/vm/sg_pager.c
==============================================================================
--- head/sys/vm/sg_pager.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/vm/sg_pager.c Thu May 6 18:58:32 2010 (r207728)
@@ -200,9 +200,7 @@ sg_pager_getpages(vm_object_t object, vm
/* 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);
Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/vm/vm_fault.c Thu May 6 18:58:32 2010 (r207728)
@@ -164,9 +164,7 @@ unlock_and_deallocate(struct faultstate
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 @@ vnode_locked:
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 @@ vnode_locked:
}
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 @@ vnode_locked:
* 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
Modified: head/sys/vm/vm_glue.c
==============================================================================
--- head/sys/vm/vm_glue.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/vm/vm_glue.c Thu May 6 18:58:32 2010 (r207728)
@@ -258,9 +258,7 @@ vm_imgact_hold_page(vm_object_t object,
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 ksob
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);
Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/vm/vm_object.c Thu May 6 18:58:32 2010 (r207728)
@@ -2046,9 +2046,7 @@ vm_object_populate(vm_object_t object, v
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;
}
Modified: head/sys/vm/vnode_pager.c
==============================================================================
--- head/sys/vm/vnode_pager.c Thu May 6 18:53:43 2010 (r207727)
+++ head/sys/vm/vnode_pager.c Thu May 6 18:58:32 2010 (r207728)
@@ -725,9 +725,7 @@ vnode_pager_generic_getpages(vp, m, byte
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, byte
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, byte
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, byte
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, byte
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, byte
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, byte
(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, byte
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, byte
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);
More information about the svn-src-head
mailing list