BIG MEMORY HANG
authorWilliam Jolitz <wjolitz@soda.berkeley.edu>
Sat, 15 Aug 1992 00:00:00 +0000 (00:00 +0000)
committerWilliam Jolitz <wjolitz@soda.berkeley.edu>
Sat, 15 Aug 1992 00:00:00 +0000 (00:00 +0000)
Because of the number of kernel map entries being to small
and an inappropriate calculation for the number of buffer pages, it was
possible for the kernel to hang if you had more than 8 Meg of memory
installed in your system.

AUTHOR: William Jolitz (withheld)
386BSD-Patchkit: patch00002

usr/src/sys.386bsd/i386/i386/machdep.c
usr/src/sys.386bsd/vm/vm_map.h

index 35e5575..166dc77 100644 (file)
  * SUCH DAMAGE.
  *
  *     @(#)machdep.c   7.4 (Berkeley) 6/3/91
  * SUCH DAMAGE.
  *
  *     @(#)machdep.c   7.4 (Berkeley) 6/3/91
+ *
+ * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
+ * --------------------         -----   ----------------------
+ * CURRENT PATCH LEVEL:         1       00002
+ * --------------------         -----   ----------------------
+ *
+ * 15 Aug 92    William Jolitz         Large memory bug
  */
 static char rcsid[] = "$Header: /usr/src/sys.386bsd/i386/i386/RCS/machdep.c,v 1.2 92/01/21 14:22:09 william Exp Locker: root $";
 
  */
 static char rcsid[] = "$Header: /usr/src/sys.386bsd/i386/i386/RCS/machdep.c,v 1.2 92/01/21 14:22:09 william Exp Locker: root $";
 
@@ -167,6 +174,11 @@ again:
                        bufpages = physmem / 10 / CLSIZE;
                else
                        bufpages = ((2 * 1024 * 1024 + physmem) / 20) / CLSIZE;
                        bufpages = physmem / 10 / CLSIZE;
                else
                        bufpages = ((2 * 1024 * 1024 + physmem) / 20) / CLSIZE;
+        /*
+         * 15 Aug 92    William Jolitz          bufpages fix for too large
+         */
+        bufpages = min( NKMEMCLUSTERS/2, bufpages);
+
        if (nbuf == 0) {
                nbuf = bufpages / 2;
                if (nbuf < 16)
        if (nbuf == 0) {
                nbuf = bufpages / 2;
                if (nbuf < 16)
index 719c984..0f4e016 100644 (file)
  *
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
+ *
+ * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
+ * --------------------         -----   ----------------------
+ * CURRENT PATCH LEVEL:         1       00002
+ * --------------------         -----   ----------------------
+ *
+ * 15 Aug 92    William Jolitz         Prevent running out of map entries...
  */
 
 /*
  */
 
 /*
@@ -199,6 +206,11 @@ void               vm_map_verify_done();
 
 /* XXX: number of kernel maps and entries to statically allocate */
 #define MAX_KMAP       10
 
 /* XXX: number of kernel maps and entries to statically allocate */
 #define MAX_KMAP       10
-#define        MAX_KMAPENT     500
+
+#ifdef OMIT
+#define MAX_KMAPENT     500
+#else   /* !OMIT*/
+#define MAX_KMAPENT     1000   /* 15 Aug 92*/
+#endif  /* !OMIT*/
 
 #endif _VM_MAP_
 
 #endif _VM_MAP_