summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-02-17 09:08:29 +0000
committerdillon <dillon@FreeBSD.org>1999-02-17 09:08:29 +0000
commite819b6214db411651f8862becf52d7480ba20bcd (patch)
tree922be1c584de5867549d2c49317f8685cbb2a8d4 /sys/vm
parent925ba1cac313633ad091d607b5fa52fd3e712ec5 (diff)
downloadFreeBSD-src-e819b6214db411651f8862becf52d7480ba20bcd.zip
FreeBSD-src-e819b6214db411651f8862becf52d7480ba20bcd.tar.gz
Submitted by: Luoqi Chen <luoqi@watermarkgroup.com>
Unlock vnode before messing with map to avoid deadlock between map and vnode ( e.g. with exec_map and underlying program binary vnode ). Solves a deadlock that most often occurs during a large -j# buildworld reported by three people.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_fault.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index fa1261f..d453f7f 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -66,7 +66,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_fault.c,v 1.98 1999/01/24 06:04:52 dillon Exp $
+ * $Id: vm_fault.c,v 1.99 1999/02/07 21:48:21 dillon Exp $
*/
/*
@@ -698,6 +698,17 @@ readrest:
*/
/*
+ * Unlock vnode before the lookup to avoid deadlock. E.G.
+ * avoid a deadlock between the inode and exec_map that can
+ * occur due to locks being obtained in different orders.
+ */
+
+ if (fs.vp != NULL) {
+ vput(fs.vp);
+ fs.vp = NULL;
+ }
+
+ /*
* To avoid trying to write_lock the map while another process
* has it read_locked (in vm_map_pageable), we do not try for
* write permission. If the page is still writable, we will
OpenPOWER on IntegriCloud