1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Reduce the number of times that we acquire and release the page queues

lock by making vm_page_rename()'s caller, rather than vm_page_rename(),
responsible for acquiring it.
This commit is contained in:
Alan Cox 2002-12-29 07:17:06 +00:00
parent 9d36cde4bf
commit a28cc55e5b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108384
4 changed files with 2 additions and 8 deletions

View File

@ -125,9 +125,7 @@ vm_pgmoveco(mapa, srcobj, kaddr, uaddr)
}
kpindex = kern_pg->pindex;
vm_page_busy(kern_pg);
vm_page_unlock_queues();
vm_page_rename(kern_pg, uobject, upindex);
vm_page_lock_queues();
vm_page_flag_clear(kern_pg, PG_BUSY);
kern_pg->valid = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();

View File

@ -704,7 +704,6 @@ RetryFault:;
vm_page_lock_queues();
pmap_remove_all(fs.first_m);
vm_page_free(fs.first_m);
vm_page_unlock_queues();
fs.first_m = NULL;
/*
@ -714,7 +713,6 @@ RetryFault:;
*/
vm_page_rename(fs.m, fs.first_object, fs.first_pindex);
fs.first_m = fs.m;
vm_page_lock_queues();
vm_page_busy(fs.first_m);
vm_page_unlock_queues();
fs.m = NULL;

View File

@ -1245,10 +1245,8 @@ vm_object_split(vm_map_entry_t entry)
goto retry;
vm_page_busy(m);
vm_page_unlock_queues();
vm_page_rename(m, new_object, idx);
/* page automatically made dirty by rename and cache handled */
vm_page_lock_queues();
vm_page_busy(m);
vm_page_unlock_queues();
}
@ -1455,7 +1453,9 @@ vm_object_backing_scan(vm_object_t object, int op)
* If the page was mapped to a process, it can remain
* mapped through the rename.
*/
vm_page_lock_queues();
vm_page_rename(p, object, new_pindex);
vm_page_unlock_queues();
/* page automatically made dirty by rename */
}
p = next;

View File

@ -682,13 +682,11 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex)
int s;
s = splvm();
vm_page_lock_queues();
vm_page_remove(m);
vm_page_insert(m, new_object, new_pindex);
if (m->queue - m->pc == PQ_CACHE)
vm_page_deactivate(m);
vm_page_dirty(m);
vm_page_unlock_queues();
splx(s);
}