Subject: Re: UVM failure :(
To: Michael L. Hitch <mhitch@lightning.oscs.montana.edu>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 11/28/1998 19:30:27
I was about to commit something like the following.  it makes it much
clearer what's going on, and also where we lose if, say, maxproc gets
bumped via sysctl.

Does this look OK?

BTW, I also just committed a change to pmap.c to fix mdsetimage not
working with UVM... Michael, if it looks OK to you, maybe the #ifdef
notdef's should be #if !defined(UVM) or something...



Index: pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/mips/pmap.c,v
retrieving revision 1.44
diff -u -r1.44 pmap.c
--- pmap.c	1998/11/29 03:18:32	1.44
+++ pmap.c	1998/11/29 03:31:10
@@ -251,12 +251,26 @@
 
 	/*
 	 * Allocate a PTE table for the kernel.
-	 * The '1024' comes from PAGER_MAP_SIZE in vm_pager_init().
-	 * This should be kept in sync.
 	 * We also reserve space for kmem_alloc_pageable() for vm_fork().
 	 */
 	Sysmapsize = (VM_KMEM_SIZE + VM_MBUF_SIZE + VM_PHYS_SIZE +
-		nbuf * MAXBSIZE + 16 * NCARGS) / NBPG + 1024 + 256;
+		nbuf * MAXBSIZE + 16 * NCARGS) / NBPG;
+	/*
+	 * Allocate PTE space space for u-areas (XXX)
+	 */
+	Sysmapsize += (maxproc * UPAGES);
+
+	/*
+	 * Allocate kernel virtual-address space for swap maps.
+	 * (This should be kept in sync with vm).
+	 */
+#if defined(UVM)
+	Sysmapsize += 2048;
+#else
+	/* the '1024' comes from PAGER_MAP_SIZE in vm_pager_init(). */
+	Sysmapsize += 1024;
+#endif
+
 #ifdef SYSVSHM
 	Sysmapsize += shminfo.shmall;
 #endif