From aa5368c1ecfd59ddcd4967e2fb9cf0420fe430d4 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 21 Jul 2015 00:05:52 +0200 Subject: yyy vm: destroy pages --- vm/vm_object.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'vm') diff --git a/vm/vm_object.c b/vm/vm_object.c index 3b7506d..344ce5e 100644 --- a/vm/vm_object.c +++ b/vm/vm_object.c @@ -756,7 +756,7 @@ void memory_object_release( void vm_object_abort_activity( vm_object_t object) { - vm_page_t p; + vm_page_t p, old_p; assert(have_vm_object_lock(object)); @@ -770,6 +770,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. @@ -782,8 +783,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); } -- cgit v1.2.3