diff options
author | alfred <alfred@FreeBSD.org> | 2001-05-19 01:28:09 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-05-19 01:28:09 +0000 |
commit | a3f0842419d98da211706f921fc626e160cd960b (patch) | |
tree | e86922a5639c32e1242d4f3088fc487f3be5b236 /sys/vm/vm_init.c | |
parent | 9eda9187f024233436e6a743f13bd938b1a0f19c (diff) | |
download | FreeBSD-src-a3f0842419d98da211706f921fc626e160cd960b.zip FreeBSD-src-a3f0842419d98da211706f921fc626e160cd960b.tar.gz |
Introduce a global lock for the vm subsystem (vm_mtx).
vm_mtx does not recurse and is required for most low level
vm operations.
faults can not be taken without holding Giant.
Memory subsystems can now call the base page allocators safely.
Almost all atomic ops were removed as they are covered under the
vm mutex.
Alpha and ia64 now need to catch up to i386's trap handlers.
FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).
Reviewed (partially) by: jake, jhb
Diffstat (limited to 'sys/vm/vm_init.c')
-rw-r--r-- | sys/vm/vm_init.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/vm/vm_init.c b/sys/vm/vm_init.c index ae336e1..35e4676 100644 --- a/sys/vm/vm_init.c +++ b/sys/vm/vm_init.c @@ -73,6 +73,7 @@ #include <sys/lock.h> #include <sys/proc.h> #include <sys/systm.h> +#include <sys/mutex.h> #include <vm/vm.h> #include <vm/vm_object.h> @@ -96,16 +97,20 @@ SYSINIT(vm_mem, SI_SUB_VM, SI_ORDER_FIRST, vm_mem_init, NULL) * The start and end address of physical memory is passed in. */ +struct mtx vm_mtx; + /* ARGSUSED*/ static void vm_mem_init(dummy) void *dummy; { + /* * Initializes resident memory structures. From here on, all physical * memory is accounted for, and we use only virtual addresses. */ - + mtx_init(&vm_mtx, "vm", MTX_DEF); + mtx_lock(&vm_mtx); vm_set_page_size(); virtual_avail = vm_page_startup(avail_start, avail_end, virtual_avail); @@ -118,4 +123,5 @@ vm_mem_init(dummy) kmem_init(virtual_avail, virtual_end); pmap_init(avail_start, avail_end); vm_pager_init(); + mtx_unlock(&vm_mtx); } |