PERFORCE change 56647 for review

Peter Wemm peter at FreeBSD.org
Tue Jul 6 16:47:18 PDT 2004


http://perforce.freebsd.org/chv.cgi?CH=56647

Change 56647 by peter at peter_daintree on 2004/07/06 23:47:07

	move the pmap_pinit/pmap_release to the vmspace init/fini
	routines.  This causes us to keep an almost-empty page
	directory associated with each vmspace in the zone.  In this
	case "almost" means that userland has been removed, just the
	kernel bits are active.  This leads to some interesting optimization
	possiblities because we can almost completely avoid the pmap_lazyfix
	shootdown problems since the pmaps will remain usable even after
	the vmspace has been "freed".

Affected files ...

.. //depot/projects/hammer/sys/vm/vm_map.c#38 edit

Differences ...

==== //depot/projects/hammer/sys/vm/vm_map.c#38 (text+ko) ====

@@ -175,7 +175,7 @@
 	struct vmspace *vm;
 
 	vm = (struct vmspace *)mem;
-
+	pmap_release(vmspace_pmap(vm));
 	vm_map_zfini(&vm->vm_map, sizeof(vm->vm_map));
 }
 
@@ -187,6 +187,7 @@
 	vm = (struct vmspace *)mem;
 
 	vm_map_zinit(&vm->vm_map, sizeof(vm->vm_map));
+	pmap_pinit(vmspace_pmap(vm));
 }
 
 static void
@@ -254,7 +255,6 @@
 	vm = uma_zalloc(vmspace_zone, M_WAITOK);
 	CTR1(KTR_VM, "vmspace_alloc: %p", vm);
 	_vm_map_init(&vm->vm_map, min, max);
-	pmap_pinit(vmspace_pmap(vm));
 	vm->vm_map.pmap = vmspace_pmap(vm);		/* XXX */
 	vm->vm_refcnt = 1;
 	vm->vm_shm = NULL;
@@ -299,7 +299,6 @@
 	    vm->vm_map.max_offset);
 	vm_map_unlock(&vm->vm_map);
 
-	pmap_release(vmspace_pmap(vm));
 	uma_zfree(vmspace_zone, vm);
 }
 


More information about the p4-projects mailing list