- Synchronize access to a vm page's valid field using the containing

vm object's lock.
 - Release the vm object and vm page queues locks around vput().
This commit is contained in:
Alan Cox 2003-10-17 05:07:17 +00:00
parent c9c373b093
commit 6989c456b3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121150

View File

@ -837,19 +837,23 @@ vm_pageout_scan(int pass)
} else {
vm_page_dirty(m);
}
/*
* Invalid pages can be easily freed
*/
object = m->object;
if (!VM_OBJECT_TRYLOCK(object))
continue;
if (m->valid == 0) {
vm_pageout_page_free(m);
/*
* Invalid pages can be easily freed
*/
vm_page_busy(m);
pmap_remove_all(m);
vm_page_free(m);
cnt.v_dfree++;
--page_shortage;
/*
* Clean pages can be placed onto the cache queue. This
* effectively frees them.
*/
} else if (m->dirty == 0) {
/*
* Clean pages can be placed onto the cache queue.
* This effectively frees them.
*/
vm_page_cache(m);
--page_shortage;
} else if ((m->flags & PG_WINATCFLS) == 0 && pass == 0) {
@ -879,9 +883,6 @@ vm_pageout_scan(int pass)
struct vnode *vp = NULL;
struct mount *mp;
object = m->object;
if (!VM_OBJECT_TRYLOCK(object))
continue;
if ((object->type != OBJT_SWAP) && (object->type != OBJT_DEFAULT)) {
swap_pageouts_ok = 1;
} else {
@ -1008,12 +1009,16 @@ vm_pageout_scan(int pass)
TAILQ_REMOVE(&vm_page_queues[PQ_INACTIVE].pl, &marker, pageq);
splx(s);
unlock_and_continue:
VM_OBJECT_UNLOCK(object);
if (vp) {
vm_page_unlock_queues();
vput(vp);
vn_finished_write(mp);
vm_page_lock_queues();
}
VM_OBJECT_UNLOCK(object);
continue;
}
VM_OBJECT_UNLOCK(object);
}
/*