aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/phys_pager.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
commit0cddd8f02397756cbeca5c5777d5895f3e419d88 (patch)
tree7420cce169451a74c5b87963467a4aeff668ed12 /sys/vm/phys_pager.c
parentd68b700a78ba6d4f1436aa6d21e47378a00a439b (diff)
downloadsrc-0cddd8f02397756cbeca5c5777d5895f3e419d88.tar.gz
src-0cddd8f02397756cbeca5c5777d5895f3e419d88.zip
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.
Notes
Notes: svn path=/head/; revision=79224
Diffstat (limited to 'sys/vm/phys_pager.c')
-rw-r--r--sys/vm/phys_pager.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c
index b3355c7f5eee..8ac32d00f9c1 100644
--- a/sys/vm/phys_pager.c
+++ b/sys/vm/phys_pager.c
@@ -31,6 +31,7 @@
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/lock.h>
+#include <sys/proc.h>
#include <sys/mutex.h>
#include <sys/mman.h>
#include <sys/sysctl.h>
@@ -62,6 +63,8 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
{
vm_object_t object;
+ GIANT_REQUIRED;
+
/*
* Offset should be page aligned.
*/
@@ -76,7 +79,7 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
*/
while (phys_pager_alloc_lock) {
phys_pager_alloc_lock = -1;
- msleep(&phys_pager_alloc_lock, &vm_mtx, PVM, "swpalc", 0);
+ tsleep(&phys_pager_alloc_lock, PVM, "swpalc", 0);
}
phys_pager_alloc_lock = 1;