Subject: Re: New kinetic figures
To: Chris Gilbert <chris@paradox.demon.co.uk>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-arm32
Date: 02/09/2001 20:55:20
On Fri, Feb 09, 2001 at 11:46:20PM +0000, Chris Gilbert wrote:

 > Oh updated make configure time is, which is half that it is when UVMHIST is 
 > enabled (doh):
 > 	106.59 real        20.35 user        62.93 sys
 > I'm going to try it with the new bootloader in a mo.
 > 
 > Anyway either give push the process creation and destruction.

So, this will make the umapping of the entire address space happen
while the process is not curproc.  In fact, the unmap in the non-curproc
path was already happening, but there was a redundant unmap in exit1().

It made things ever so slightly faster on my 700MHz P-III -- I wasn't
expecting to see much improvement on that system :-)  Anyway, please
try it on your ARM systems and tell me what improvement you see.

(I'm considering just committing it anyhow, since the unmap in exit1()
is clearly redundant...)

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>

Index: kern/kern_exit.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/kern_exit.c,v
retrieving revision 1.87
diff -c -r1.87 kern_exit.c
*** kern/kern_exit.c	2000/12/22 22:59:00	1.87
--- kern/kern_exit.c	2001/02/10 04:48:24
***************
*** 143,149 ****
  exit1(struct proc *p, int rv)
  {
  	struct proc *q, *nq;
- 	struct vmspace *vm;
  	int s;
  
  	if (__predict_false(p == initproc))
--- 143,148 ----
***************
*** 177,203 ****
  	fdfree(p);
  	cwdfree(p);
  
- 	/* The next three chunks should probably be moved to vmspace_exit. */
- 	vm = p->p_vmspace;
- #ifdef SYSVSHM
- 	if (vm->vm_shm && vm->vm_refcnt == 1)
- 		shmexit(vm);
- #endif
  #ifdef SYSVSEM
  	semexit(p);
  #endif
- 	/*
- 	 * Release user portion of address space.
- 	 * This releases references to vnodes,
- 	 * which could cause I/O if the file has been unlinked.
- 	 * Need to do this early enough that we can still sleep.
- 	 * Can't free the entire vmspace as the kernel stack
- 	 * may be mapped within that space also.
- 	 */
- 	if (vm->vm_refcnt == 1)
- 		(void) uvm_deallocate(&vm->vm_map, VM_MIN_ADDRESS,
- 		    VM_MAXUSER_ADDRESS - VM_MIN_ADDRESS);
- 
  	if (SESS_LEADER(p)) {
  		struct session *sp = p->p_session;
  
--- 176,184 ----
Index: uvm/uvm_map.c
===================================================================
RCS file: /cvsroot/syssrc/sys/uvm/uvm_map.c,v
retrieving revision 1.91
diff -c -r1.91 uvm_map.c
*** uvm/uvm_map.c	2001/02/06 17:01:51	1.91
--- uvm/uvm_map.c	2001/02/10 04:48:27
***************
*** 2849,2854 ****
--- 2849,2859 ----
  		 * all of the mappings and pages they hold, then call the pmap
  		 * module to reclaim anything left.
  		 */
+ #ifdef SYSVSHM
+ 		/* Get rid of any SYSV shared memory segments. */
+ 		if (vm->vm_shm != NULL)
+ 			shmexit(vm);
+ #endif
  		vm_map_lock(&vm->vm_map);
  		if (vm->vm_map.nentries) {
  			(void)uvm_unmap_remove(&vm->vm_map,