mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-26 19:54:57 +00:00
Fixed object cache trimming policy so it actually works.
Submitted by: John Dyson
This commit is contained in:
parent
389918ee95
commit
e8fbe458e4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3815
|
@ -65,7 +65,7 @@
|
||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*
|
*
|
||||||
* $Id: vm_pageout.c,v 1.20 1994/10/22 02:18:03 davidg Exp $
|
* $Id: vm_pageout.c,v 1.21 1994/10/23 20:53:33 davidg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -511,26 +511,24 @@ vm_pageout_scan()
|
||||||
cache_size = orig_cache_size;
|
cache_size = orig_cache_size;
|
||||||
object = vm_object_cached_list.tqh_first;
|
object = vm_object_cached_list.tqh_first;
|
||||||
vm_object_cache_lock();
|
vm_object_cache_lock();
|
||||||
while ( object && (cnt.v_inactive_count < cnt.v_inactive_target) &&
|
while ( object && (cnt.v_inactive_count < cnt.v_inactive_target)) {
|
||||||
(cache_size >= (vm_swap_size?vm_desired_cache_size:0))) {
|
|
||||||
vm_object_cache_unlock();
|
vm_object_cache_unlock();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if there are no resident pages -- get rid of the object
|
* if there are no resident pages -- get rid of the object
|
||||||
*/
|
*/
|
||||||
if( object->resident_page_count == 0) {
|
if( object->resident_page_count == 0) {
|
||||||
if (object != vm_object_lookup(object->pager))
|
if (object != vm_object_lookup(object->pager))
|
||||||
panic("vm_object_deactivate: I'm sooo confused.");
|
panic("vm_pageout_scan: I'm sooo confused.");
|
||||||
pager_cache(object, FALSE);
|
pager_cache(object, FALSE);
|
||||||
goto redeact;
|
goto redeact;
|
||||||
} else {
|
} else if( cache_size >= (vm_swap_size?vm_desired_cache_size:0)) {
|
||||||
/*
|
/*
|
||||||
* if there are resident pages -- deactivate them
|
* if there are resident pages -- deactivate them
|
||||||
*/
|
*/
|
||||||
vm_object_deactivate_pages(object);
|
vm_object_deactivate_pages(object);
|
||||||
cache_size -= object->resident_page_count;
|
cache_size -= object->resident_page_count;
|
||||||
object = object->cached_list.tqe_next;
|
|
||||||
}
|
}
|
||||||
|
object = object->cached_list.tqe_next;
|
||||||
|
|
||||||
vm_object_cache_lock();
|
vm_object_cache_lock();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue