Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Feb 2000 17:43:01 +0000 (GMT)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Peter Wemm <peter@netplex.com.au>
Cc:        Vladimir Kravchuk <adm@smr.ru>, Andrew Gallatin <gallatin@cs.duke.edu>, freebsd-alpha@FreeBSD.ORG
Subject:   Re: UP2000/DP264 
Message-ID:  <Pine.BSF.4.21.0002261739171.8714-100000@salmon.nlsystems.com>
In-Reply-To: <20000225143538.5E0B31CE0@overcee.netplex.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 25 Feb 2000, Peter Wemm wrote:

> Doug Rabson wrote:
> > On Fri, 25 Feb 2000, Vladimir Kravchuk wrote:
> > 
> > > Feb 25 11:37:05 up2 /kernel: WARNING: 8192 bytes not available for
> > > msgbuf in last cluster (32768 used)
> > > !!!!!!!!!What does this warning mean?
> > 
> > I would like to see the memory map for this machine. Please add '#defined
> > DEBUG_CLUSTER' to the top of machdep.c to make it print out more
> > information about the memory it uses. Unfortunately, this will be printed
> > before the message buffer is initialised so you will have to transcribe
> > the results by hand if you don't have a serial console.
> 
> Actually, this is because of a bug in alpha/machdep.c.  MSGBUF_SIZE is 32K
> by default now, and the alpha machdep.c code assumes that anything other
> than PAGE_SIZE is an allocation error.  I'm not sure what's right, I've been
> tempted to comment out the printf.  It seems there are two different variables
> in use for the same thing, but one is out of date.

Ok, I propose making these changes. This patch nukes the bogus MSGBUFSIZE
and fixes a nasty looking bug if the message buffer size really was
truncated. It also simplifies the MDDT parsing code so that it should work
whatever or not pmap_uses_prom_console() returns.

I incorporated Andrew's patch to pmap to note that we only use the prom
console on turbochannel boxes. This is a good thing - with this patch, I
get an extra 1Mb of memory on my Miata.

Index: include/param.h
===================================================================
RCS file: /home/ncvs/src/sys/alpha/include/param.h,v
retrieving revision 1.16
diff -u -r1.16 param.h
--- include/param.h	1999/11/22 15:14:55	1.16
+++ include/param.h	2000/02/26 12:12:41
@@ -114,10 +114,6 @@
 #define	UPAGES		2		/* pages of u-area */
 #define	USPACE		(UPAGES * PAGE_SIZE) /* total size of u-area */
 
-#ifndef MSGBUFSIZE
-#define MSGBUFSIZE	PAGE_SIZE	/* default message buffer size */
-#endif
-
 /*
  * Constants related to network buffer management.
  * MCLBYTES must be no larger than CLBYTES (the software page size), and,
Index: alpha/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/alpha/alpha/machdep.c,v
retrieving revision 1.67
diff -u -r1.67 machdep.c
--- alpha/machdep.c	2000/02/13 03:31:48	1.67
+++ alpha/machdep.c	2000/02/26 12:13:32
@@ -817,6 +817,7 @@
 		       mddtp->mddt_cluster_cnt);
 	}
 
+#define DEBUG_CLUSTER
 #ifdef DEBUG_CLUSTER
 	printf("Memory cluster count: %d\n", mddtp->mddt_cluster_cnt);
 #endif
@@ -859,57 +860,55 @@
 		 * XXX memory after the kernel in the first system segment,
 		 * XXX to avoid clobbering prom mapping, data, etc.
 		 */
-		if (!pmap_uses_prom_console() || physmem == 0) {
-			physmem += memc->mddt_pg_cnt;
-			pfn0 = memc->mddt_pfn;
-			pfn1 = memc->mddt_pfn + memc->mddt_pg_cnt;
-			if (pfn0 <= kernendpfn && kernstartpfn <= pfn1) {
-				/*
-				 * Must compute the location of the kernel
-				 * within the segment.
-				 */
-#ifdef DEBUG_CLUSTER
-				printf("Cluster %d contains kernel\n", i);
-#endif
-				if (!pmap_uses_prom_console()) {
-					if (pfn0 < kernstartpfn) {
-				/*
-				 * There is a chunk before the kernel.
-				 */
-#ifdef DEBUG_CLUSTER
-						printf("Loading chunk before kernel: "
-						       "0x%lx / 0x%lx\n", pfn0, kernstartpfn);
-#endif
-						phys_avail[phys_avail_cnt] = alpha_ptob(pfn0);
-						phys_avail[phys_avail_cnt+1] = alpha_ptob(kernstartpfn);
-						phys_avail_cnt += 2;
-					}
-				}
-				if (kernendpfn < pfn1) {
-				/*
-				 * There is a chunk after the kernel.
-				 */
+		physmem += memc->mddt_pg_cnt;
+		pfn0 = memc->mddt_pfn;
+		pfn1 = memc->mddt_pfn + memc->mddt_pg_cnt;
+		if (pfn0 <= kernendpfn && kernstartpfn <= pfn1) {
+			/*
+			 * Must compute the location of the kernel
+			 * within the segment.
+			 */
+#ifdef DEBUG_CLUSTER
+			printf("Cluster %d contains kernel\n", i);
+#endif
+			if (!pmap_uses_prom_console()) {
+				if (pfn0 < kernstartpfn) {
+					/*
+					 * There is a chunk before the kernel.
+					 */
 #ifdef DEBUG_CLUSTER
-					printf("Loading chunk after kernel: "
-					       "0x%lx / 0x%lx\n", kernendpfn, pfn1);
+					printf("Loading chunk before kernel: "
+					       "0x%lx / 0x%lx\n", pfn0, kernstartpfn);
 #endif
-					phys_avail[phys_avail_cnt] = alpha_ptob(kernendpfn);
-					phys_avail[phys_avail_cnt+1] = alpha_ptob(pfn1);
+					phys_avail[phys_avail_cnt] = alpha_ptob(pfn0);
+					phys_avail[phys_avail_cnt+1] = alpha_ptob(kernstartpfn);
 					phys_avail_cnt += 2;
 				}
-			} else {
+			}
+			if (kernendpfn < pfn1) {
 				/*
-				 * Just load this cluster as one chunk.
+				 * There is a chunk after the kernel.
 				 */
 #ifdef DEBUG_CLUSTER
-				printf("Loading cluster %d: 0x%lx / 0x%lx\n", i,
-				       pfn0, pfn1);
+				printf("Loading chunk after kernel: "
+				       "0x%lx / 0x%lx\n", kernendpfn, pfn1);
 #endif
-				phys_avail[phys_avail_cnt] = alpha_ptob(pfn0);
+				phys_avail[phys_avail_cnt] = alpha_ptob(kernendpfn);
 				phys_avail[phys_avail_cnt+1] = alpha_ptob(pfn1);
 				phys_avail_cnt += 2;
-			
 			}
+		} else {
+			/*
+			 * Just load this cluster as one chunk.
+			 */
+#ifdef DEBUG_CLUSTER
+			printf("Loading cluster %d: 0x%lx / 0x%lx\n", i,
+			       pfn0, pfn1);
+#endif
+			phys_avail[phys_avail_cnt] = alpha_ptob(pfn0);
+			phys_avail[phys_avail_cnt+1] = alpha_ptob(pfn1);
+			phys_avail_cnt += 2;
+			
 		}
 	}
 	phys_avail[phys_avail_cnt] = 0;
@@ -956,16 +955,16 @@
 		phys_avail[i+1] -= sz;
 		msgbufp = (struct msgbuf*) ALPHA_PHYS_TO_K0SEG(phys_avail[i+1]);
 
-		msgbufinit(msgbufp, MSGBUF_SIZE);
+		msgbufinit(msgbufp, sz);
 
 		/* Remove the last segment if it now has no pages. */
 		if (phys_avail[i] == phys_avail[i+1])
 			phys_avail[i] = 0;
 
 		/* warn if the message buffer had to be shrunk */
-		if (sz != round_page(MSGBUFSIZE))
+		if (sz != round_page(MSGBUF_SIZE))
 			printf("WARNING: %ld bytes not available for msgbuf in last cluster (%ld used)\n",
-			    round_page(MSGBUFSIZE), sz);
+			    round_page(MSGBUF_SIZE), sz);
 
 	}
 
Index: alpha/pmap.c
===================================================================
RCS file: /home/ncvs/src/sys/alpha/alpha/pmap.c,v
retrieving revision 1.34
diff -u -r1.34 pmap.c
--- alpha/pmap.c	1999/11/19 21:34:50	1.34
+++ alpha/pmap.c	2000/02/26 17:35:25
@@ -172,6 +172,7 @@
 #include <sys/user.h>
 
 #include <machine/md_var.h>
+#include <machine/rpb.h>
 
 #ifndef PMAP_SHPGPERPROC
 #define PMAP_SHPGPERPROC 200
@@ -606,19 +607,14 @@
 int
 pmap_uses_prom_console()
 {
-#if 0
-	extern int cputype;
+	int cputype;
 
-#if defined(NEW_SCC_DRIVER)
-	return (cputype == ST_DEC_21000);
-#else
+	cputype = hwrpb->rpb_type;
 	return (cputype == ST_DEC_21000
 	     || cputype == ST_DEC_3000_300
 	     || cputype == ST_DEC_3000_500);
-#endif /* NEW_SCC_DRIVER */
-#endif
 
-	return 1;
+	return 0;
 }
 
 /*

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 442 9037




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0002261739171.8714-100000>