summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 25290e6..84197ea 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -79,7 +79,7 @@
#include <vm/vm_param.h>
#include <vm/vm_inherit.h>
#include <vm/vm_prot.h>
-#include <vm/lock.h>
+#include <sys/lock.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_page.h>
@@ -424,9 +424,11 @@ retry:
vm_map_reference(&vm->vm_map);
/*
* do not swapout a process that is waiting for VM
- * datastructures there is a possible deadlock.
+ * data structures there is a possible deadlock.
*/
- if (!lock_try_write(&vm->vm_map.lock)) {
+ if (lockmgr(&vm->vm_map.lock,
+ LK_EXCLUSIVE | LK_NOWAIT,
+ (void *)0, curproc)) {
vm_map_deallocate(&vm->vm_map);
vmspace_free(vm);
continue;
OpenPOWER on IntegriCloud