summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-07-21 00:05:52 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-08-15 13:08:49 +0200
commite5a1e3a50792b9429989a8add50a7dfeae7c36fb (patch)
treebe933de2efcd7570a952955a6e5fec51abf41405 /vm
parentb491ec2ace37fa562b6e979e664844e1db244e1d (diff)
yyy vm: destroy pages
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_object.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/vm/vm_object.c b/vm/vm_object.c
index 3c7d73c..c650b8c 100644
--- a/vm/vm_object.c
+++ b/vm/vm_object.c
@@ -735,7 +735,7 @@ void memory_object_release(
void vm_object_abort_activity(
vm_object_t object)
{
- vm_page_t p;
+ vm_page_t p, old_p;
/*
* Abort all activity that would be waiting
@@ -747,6 +747,7 @@ void vm_object_abort_activity(
*/
struct rdxtree_iter iter;
+ old_p = NULL;
rdxtree_for_each(&object->memt, &iter, p) {
/*
* If it's being paged in, destroy it.
@@ -759,8 +760,16 @@ void vm_object_abort_activity(
else {
if (p->unlock_request != VM_PROT_NONE)
p->unlock_request = VM_PROT_NONE;
- PAGE_WAKEUP(p);
+ if (p == old_p)
+ /* We tried to wake this up last time.
+ We must assume this failed, and
+ destroy this page to avoid looping
+ forever. */
+ VM_PAGE_FREE(p);
+ else
+ PAGE_WAKEUP(p);
}
+ old_p = p;
rdxtree_iter_init(&iter);
}