summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.h
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2010-12-09 21:02:22 +0000
committermlaier <mlaier@FreeBSD.org>2010-12-09 21:02:22 +0000
commitda2dde653e0b4157a383ca260e51c5bcf85a7414 (patch)
tree7178a019174177fb597d3725c8f21cebe38f24ae /sys/vm/vm_map.h
parentc3ffedd66b60efcf18ea15901fee16f8cbd58649 (diff)
downloadFreeBSD-src-da2dde653e0b4157a383ca260e51c5bcf85a7414.zip
FreeBSD-src-da2dde653e0b4157a383ca260e51c5bcf85a7414.tar.gz
Fix a long standing (from the original 4.4BSD lite sources) race between
vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page missing" panics. While faulting in pages for a map entry that is being wired down, mark the containing map as busy. In vmspace_fork wait until the map is unbusy, before we try to copy the entries. Reviewed by: kib MFC after: 5 days Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/vm/vm_map.h')
-rw-r--r--sys/vm/vm_map.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index f7fc5f5..fecbffe 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -187,12 +187,14 @@ struct vm_map {
pmap_t pmap; /* (c) Physical map */
#define min_offset header.start /* (c) */
#define max_offset header.end /* (c) */
+ int busy;
};
/*
* vm_flags_t values
*/
#define MAP_WIREFUTURE 0x01 /* wire all future pages */
+#define MAP_BUSY_WAKEUP 0x02
#ifdef _KERNEL
static __inline vm_offset_t
@@ -275,6 +277,9 @@ int _vm_map_lock_upgrade(vm_map_t map, const char *file, int line);
void _vm_map_lock_downgrade(vm_map_t map, const char *file, int line);
int vm_map_locked(vm_map_t map);
void vm_map_wakeup(vm_map_t map);
+void vm_map_busy(vm_map_t map);
+void vm_map_unbusy(vm_map_t map);
+void vm_map_wait_busy(vm_map_t map);
#define vm_map_lock(map) _vm_map_lock(map, LOCK_FILE, LOCK_LINE)
#define vm_map_unlock(map) _vm_map_unlock(map, LOCK_FILE, LOCK_LINE)
OpenPOWER on IntegriCloud