aboutsummaryrefslogtreecommitdiff
path: root/vm/vm_pageout.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-05-16 17:10:06 +0200
committerRichard Braun <rbraun@sceen.net>2016-05-16 17:17:41 +0200
commitb4d07d3c60449dde5c567aaeb2db0cd9f39547bd (patch)
tree607ec71c34bf1417bf1ac4c4c8e7c47d8857251d /vm/vm_pageout.c
parentbbcbebe456c921fc9494fec2bd1cbe1fa6696453 (diff)
downloadgnumach-b4d07d3c60449dde5c567aaeb2db0cd9f39547bd.tar.gz
gnumach-b4d07d3c60449dde5c567aaeb2db0cd9f39547bd.tar.bz2
gnumach-b4d07d3c60449dde5c567aaeb2db0cd9f39547bd.zip
Fix pageout deadlock
The pageout daemon uses small, internal, temporary objects to transport the data out to memory managers, which are expected to release the data once written out to backing store. Releasing this data is done with a vm_deallocate call. The problem with this is that vm_map is allowed to merge these objects, in which case vm_deallocate will only remove a reference instead of releasing the underlying pages, causing the pageout daemon to deadlock. This change makes the pageout daemon mark these objects so that they don't get merged. * vm/vm_object.c (vm_object_bootstrap): Update template. (vm_object_coalesce): Don't coalesce if an object is used for pageout. * vm/vm_object.h (struct vm_object): New `used_for_pageout` member. * vm/vm_pageout.c (vm_pageout_page): Mark new objects for pageout.
Diffstat (limited to 'vm/vm_pageout.c')
-rw-r--r--vm/vm_pageout.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm/vm_pageout.c b/vm/vm_pageout.c
index 72f96cbf..f420804b 100644
--- a/vm/vm_pageout.c
+++ b/vm/vm_pageout.c
@@ -461,6 +461,7 @@ vm_pageout_page(
* Allocate a new object into which we can put the page.
*/
new_object = vm_object_allocate(PAGE_SIZE);
+ new_object->used_for_pageout = TRUE;
/*
* Move the page into the new object.