diff options
-rw-r--r-- | vm/vm_object.c | 2 | ||||
-rw-r--r-- | vm/vm_object.h | 7 | ||||
-rw-r--r-- | vm/vm_pageout.c | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/vm/vm_object.c b/vm/vm_object.c index bc301288..046b6c49 100644 --- a/vm/vm_object.c +++ b/vm/vm_object.c @@ -302,6 +302,7 @@ void vm_object_bootstrap(void) vm_object_template.all_wanted = 0; /* all bits FALSE */ vm_object_template.paging_in_progress = 0; + vm_object_template.used_for_pageout = FALSE; vm_object_template.can_persist = FALSE; vm_object_template.cached = FALSE; vm_object_template.internal = TRUE; @@ -2742,6 +2743,7 @@ boolean_t vm_object_coalesce( if ((prev_object->ref_count > 1) || prev_object->pager_created || + prev_object->used_for_pageout || (prev_object->shadow != VM_OBJECT_NULL) || (prev_object->copy != VM_OBJECT_NULL) || (prev_object->paging_in_progress != 0)) { diff --git a/vm/vm_object.h b/vm/vm_object.h index eb8a0c28..e1dd0ba1 100644 --- a/vm/vm_object.h +++ b/vm/vm_object.h @@ -113,6 +113,13 @@ struct vm_object { * of these fields (i.e., don't * collapse, destroy or terminate) */ + /* boolean_t */ used_for_pageout:1,/* The object carries data sent to + * a memory manager, which signals + * it's done by releasing memory. + * This flag prevents coalescing so + * that unmapping memory immediately + * results in object termination. + */ /* boolean_t */ pager_created:1,/* Has pager ever been created? */ /* boolean_t */ pager_initialized:1,/* Are fields ready to use? */ /* boolean_t */ pager_ready:1, /* Will manager take requests? */ 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. |