Module Name: src
Committed By: rmind
Date: Mon Jun 13 23:19:40 UTC 2011
Modified Files:
src/sys/uvm: uvm_map.c
Log Message:
uvm_map_lock_entry: fix the order of locking. Spotted by yamt@.
Also, keep uvm_map_unlock_entry() symmetric.
To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 src/sys/uvm/uvm_map.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.298 src/sys/uvm/uvm_map.c:1.299
--- src/sys/uvm/uvm_map.c:1.298 Sun Jun 12 03:36:03 2011
+++ src/sys/uvm/uvm_map.c Mon Jun 13 23:19:40 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_map.c,v 1.298 2011/06/12 03:36:03 rmind Exp $ */
+/* $NetBSD: uvm_map.c,v 1.299 2011/06/13 23:19:40 rmind Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.298 2011/06/12 03:36:03 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.299 2011/06/13 23:19:40 rmind Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -5204,24 +5204,24 @@
uvm_map_lock_entry(struct vm_map_entry *entry)
{
- if (UVM_ET_ISOBJ(entry)) {
- mutex_enter(entry->object.uvm_obj->vmobjlock);
- }
if (entry->aref.ar_amap != NULL) {
amap_lock(entry->aref.ar_amap);
}
+ if (UVM_ET_ISOBJ(entry)) {
+ mutex_enter(entry->object.uvm_obj->vmobjlock);
+ }
}
void
uvm_map_unlock_entry(struct vm_map_entry *entry)
{
- if (entry->aref.ar_amap != NULL) {
- amap_unlock(entry->aref.ar_amap);
- }
if (UVM_ET_ISOBJ(entry)) {
mutex_exit(entry->object.uvm_obj->vmobjlock);
}
+ if (entry->aref.ar_amap != NULL) {
+ amap_unlock(entry->aref.ar_amap);
+ }
}
#if defined(DDB) || defined(DEBUGPRINT)