Module Name: src
Committed By: hannken
Date: Fri Jun 17 09:50:52 UTC 2011
Modified Files:
src/sys/uvm: uvm_bio.c
Log Message:
When ubc_alloc() reuses a cached mapping window remove the object from
the lists AFTER clearing its mapping.
Removes a race where uvm_obj_destroy() sees an empty uo_ubc list and
destroys the object before ubc_alloc() gets the objects lock to clear
the mapping.
To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/uvm/uvm_bio.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_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.74 src/sys/uvm/uvm_bio.c:1.75
--- src/sys/uvm/uvm_bio.c:1.74 Thu Jun 16 09:21:03 2011
+++ src/sys/uvm/uvm_bio.c Fri Jun 17 09:50:52 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_bio.c,v 1.74 2011/06/16 09:21:03 hannken Exp $ */
+/* $NetBSD: uvm_bio.c,v 1.75 2011/06/17 09:50:52 hannken Exp $ */
/*
* Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.74 2011/06/16 09:21:03 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.75 2011/06/17 09:50:52 hannken Exp $");
#include "opt_uvmhist.h"
#include "opt_ubc.h"
@@ -507,8 +507,6 @@
*/
if (oobj != NULL) {
- LIST_REMOVE(umap, hash);
- LIST_REMOVE(umap, list);
if (umap->flags & UMAP_MAPPING_CACHED) {
umap->flags &= ~UMAP_MAPPING_CACHED;
mutex_enter(oobj->vmobjlock);
@@ -517,6 +515,8 @@
pmap_update(pmap_kernel());
mutex_exit(oobj->vmobjlock);
}
+ LIST_REMOVE(umap, hash);
+ LIST_REMOVE(umap, list);
} else {
KASSERT((umap->flags & UMAP_MAPPING_CACHED) == 0);
}