aboutsummaryrefslogtreecommitdiff
path: root/vm/vm_resident.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-10-09 11:51:54 +0200
committerRichard Braun <rbraun@sceen.net>2013-10-09 11:51:54 +0200
commit98d64d1a78172b1efc26cac36a367eec8496926f (patch)
tree6a6837406ad1ec12cc724c18a3d30293b41765c0 /vm/vm_resident.c
parent54357e27b6f3f727357b6ae93808cc5da41291a2 (diff)
downloadgnumach-98d64d1a78172b1efc26cac36a367eec8496926f.tar.gz
gnumach-98d64d1a78172b1efc26cac36a367eec8496926f.tar.bz2
gnumach-98d64d1a78172b1efc26cac36a367eec8496926f.zip
VM cache policy change
This patch lets the kernel unconditionnally cache non empty unreferenced objects instead of using a fixed arbitrary limit. As the pageout daemon evicts pages, it collects cached objects that have become empty. The effective result is a graceful adjustment of the number of objects related to memory management (virtual memory objects, their associated ports, and potentially objects maintained in the external memory managers). Physical memory can now be almost entirely filled up with cached pages. In addition, these cached pages are not automatically deactivated as objects can quickly be referenced again. There are problems with this patch however. The first is that, on machines with a large amount of physical memory (above 1 GiB but it also depends on usage patterns), scalability issues are exposed. For example, file systems which don't throttle their writeback requests can create thread storms, strongly reducing system responsiveness. Other issues such as linear scans of memory objects also add visible CPU overhead. The second is that, as most memory is used, it increases the chances of swapping deadlocks. Applications that map large objects and quickly cause lots of page faults can still easily bring the system to its knees.
Diffstat (limited to 'vm/vm_resident.c')
-rw-r--r--vm/vm_resident.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm/vm_resident.c b/vm/vm_resident.c
index 7906b583..66ab51f0 100644
--- a/vm/vm_resident.c
+++ b/vm/vm_resident.c
@@ -523,7 +523,7 @@ void vm_page_insert(
*/
object->resident_page_count++;
- assert(object->resident_page_count >= 0);
+ assert(object->resident_page_count != 0);
if (object->can_persist && (object->ref_count == 0))
vm_object_cached_pages_update(1);
@@ -630,7 +630,7 @@ void vm_page_replace(
*/
object->resident_page_count++;
- assert(object->resident_page_count >= 0);
+ assert(object->resident_page_count != 0);
if (object->can_persist && (object->ref_count == 0))
vm_object_cached_pages_update(1);