Subject: Big Amiga panic: (most of) real solution found
To: None <port-amiga@NetBSD.ORG>
From: Ignatios Souvatzis <is@jocelyn.rhein.de>
List: port-amiga
Date: 02/18/1998 23:12:12
Hello,

so, this is the story:

pmap_init() allocates a fixed number of pages for kernel page tables, which
is what overflows on big Amigas.

I don't know exactly why increasing NKMEMCLUSTERS helps. It might be that it
prevents other parts of the kernel increasing, so that less KPT pages are
needed. Anyway, it isn't directly related.

Can the people who can't boot a normal GENERIC please try the patch below,
with the LIMITMEM removed, and NKMEMCLUSTERS at 256?

Please give a short answer whether it worked...

Regards,
	Ignatios


Index: pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/amiga/pmap.c,v
retrieving revision 1.44
diff -u -r1.44 pmap.c
--- pmap.c	1998/01/22 23:13:40	1.44
+++ pmap.c	1998/02/18 22:07:03
@@ -554,7 +554,15 @@
 	 * plus some slop.
 	 */
 	npg = howmany(((maxproc + 16) * AMIGA_UPTSIZE / NPTEPG), NBPG);
-	npg = min(atop(AMIGA_MAX_KPTSIZE), npg);
+	printf("maxproc = %d, npg = %ld, ", maxproc, npg);
+	/*
+	 * Allow for up to 128 MB of _virtual_ buffer cache.
+	 * A GENERIC kernel allocates this for 16 MB of real buffer cache,
+	 * which in turn is allocated for about 320 MB of RAM.
+	 */
+	npg += 8;
+	/* npg = min(atop(AMIGA_MAX_KPTSIZE), npg); */
+	printf("-> %ld\n", npg);
 	s = ptoa(npg) + round_page(npg * sizeof(struct kpt_page));
 
 	/*