Added a new boolean argument to vm_object_page_clean that causes it to

only toss out clean pages if TRUE.
This commit is contained in:
David Greenman 1995-03-21 01:11:44 +00:00
parent ee02f1d697
commit 7c1f6cedec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7204
4 changed files with 21 additions and 10 deletions

View File

@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_map.c,v 1.16 1995/03/01 23:29:56 davidg Exp $
* $Id: vm_map.c,v 1.17 1995/03/16 18:17:14 bde Exp $
*/
/*
@ -1508,7 +1508,7 @@ vm_map_clean(map, start, end, syncio, invalidate)
return (KERN_FAILURE);
}
if (invalidate)
vm_object_page_remove(object, offset, offset + size);
vm_object_page_remove(object, offset, offset + size, FALSE);
vm_object_unlock(object);
}
start += size;
@ -1634,7 +1634,7 @@ vm_map_delete(map, start, end)
if (object == kernel_object || object == kmem_object)
vm_object_page_remove(object, entry->offset,
entry->offset + (e - s));
entry->offset + (e - s), FALSE);
else if (!map->is_main_map)
vm_object_pmap_remove(object,
entry->offset,

View File

@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_object.c,v 1.33 1995/03/20 02:06:09 davidg Exp $
* $Id: vm_object.c,v 1.34 1995/03/20 10:20:41 davidg Exp $
*/
/*
@ -1390,10 +1390,11 @@ vm_object_collapse(object)
* The object must be locked.
*/
void
vm_object_page_remove(object, start, end)
vm_object_page_remove(object, start, end, clean_only)
register vm_object_t object;
register vm_offset_t start;
register vm_offset_t end;
boolean_t clean_only;
{
register vm_page_t p, next;
vm_offset_t size;
@ -1423,6 +1424,11 @@ again:
goto again;
}
splx(s);
if (clean_only) {
vm_page_test_dirty(p);
if (p->valid & p->dirty)
continue;
}
vm_page_protect(p, VM_PROT_NONE);
vm_page_lock_queues();
PAGE_WAKEUP(p);
@ -1445,6 +1451,11 @@ again:
goto again;
}
splx(s);
if (clean_only) {
vm_page_test_dirty(p);
if (p->valid & p->dirty)
continue;
}
vm_page_protect(p, VM_PROT_NONE);
vm_page_lock_queues();
PAGE_WAKEUP(p);
@ -1524,7 +1535,7 @@ vm_object_coalesce(prev_object, next_object,
vm_object_page_remove(prev_object,
prev_offset + prev_size,
prev_offset + prev_size + next_size);
prev_offset + prev_size + next_size, FALSE);
/*
* Extend the object if necessary.

View File

@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_object.h,v 1.13 1995/03/16 18:17:24 bde Exp $
* $Id: vm_object.h,v 1.14 1995/03/20 10:14:55 davidg Exp $
*/
/*
@ -175,7 +175,7 @@ void vm_object_enter __P((vm_object_t, vm_pager_t));
void vm_object_init __P((vm_size_t));
vm_object_t vm_object_lookup __P((vm_pager_t));
boolean_t vm_object_page_clean __P((vm_object_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t));
void vm_object_page_remove __P((vm_object_t, vm_offset_t, vm_offset_t));
void vm_object_page_remove __P((vm_object_t, vm_offset_t, vm_offset_t, boolean_t));
void vm_object_pmap_copy __P((vm_object_t, vm_offset_t, vm_offset_t));
void vm_object_pmap_remove __P((vm_object_t, vm_offset_t, vm_offset_t));
void vm_object_print __P((vm_object_t, boolean_t));

View File

@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
* $Id: vnode_pager.c,v 1.32 1995/03/19 23:46:25 davidg Exp $
* $Id: vnode_pager.c,v 1.33 1995/03/20 10:20:42 davidg Exp $
*/
/*
@ -374,7 +374,7 @@ vnode_pager_setsize(vp, nsize)
if (round_page((vm_offset_t) nsize) < vnp->vnp_size) {
vm_object_lock(object);
vm_object_page_remove(object,
round_page((vm_offset_t) nsize), vnp->vnp_size);
round_page((vm_offset_t) nsize), vnp->vnp_size, FALSE);
vm_object_unlock(object);
}
/*