summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.h
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
committerdillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
commite028603b7e3e4fb35cdf00aab533f3965f4a13cc (patch)
tree7420cce169451a74c5b87963467a4aeff668ed12 /sys/vm/vm_map.h
parent0b028660051eb7abf4306d34e7fec0e7fde86a28 (diff)
downloadFreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.zip
FreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.tar.gz
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
Diffstat (limited to 'sys/vm/vm_map.h')
-rw-r--r--sys/vm/vm_map.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index 5ea3ccf..5442c85 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -212,7 +212,6 @@ struct vmspace {
do { \
lockmgr(&(map)->lock, LK_DRAIN|LK_INTERLOCK, \
&(map)->ref_lock, curproc); \
- mtx_lock(&vm_mtx); \
(map)->timestamp++; \
} while(0)
@@ -227,11 +226,9 @@ struct vmspace {
#define vm_map_lock(map) \
do { \
vm_map_printf("locking map LK_EXCLUSIVE: %p\n", map); \
- mtx_assert(&vm_mtx, MA_OWNED); \
- if (lockmgr(&(map)->lock, LK_EXCLUSIVE | LK_INTERLOCK, \
- &vm_mtx, curproc) != 0) \
+ if (lockmgr(&(map)->lock, LK_EXCLUSIVE, \
+ NULL, curproc) != 0) \
panic("vm_map_lock: failed to get lock"); \
- mtx_lock(&vm_mtx); \
(map)->timestamp++; \
} while(0)
@@ -244,10 +241,8 @@ struct vmspace {
#define vm_map_lock_read(map) \
do { \
vm_map_printf("locking map LK_SHARED: %p\n", map); \
- mtx_assert(&vm_mtx, MA_OWNED); \
- lockmgr(&(map)->lock, LK_SHARED | LK_INTERLOCK, \
- &vm_mtx, curproc); \
- mtx_lock(&vm_mtx); \
+ lockmgr(&(map)->lock, LK_SHARED, \
+ NULL, curproc); \
} while (0)
#define vm_map_unlock_read(map) \
@@ -261,8 +256,7 @@ _vm_map_lock_upgrade(vm_map_t map, struct proc *p) {
int error;
vm_map_printf("locking map LK_EXCLUPGRADE: %p\n", map);
- error = lockmgr(&map->lock, LK_EXCLUPGRADE | LK_INTERLOCK, &vm_mtx, p);
- mtx_lock(&vm_mtx);
+ error = lockmgr(&map->lock, LK_EXCLUPGRADE, NULL, p);
if (error == 0)
map->timestamp++;
return error;
OpenPOWER on IntegriCloud