options MSGBUFSIZE=

Julian Coleman <[email protected]>
Newsgroups gmane.os.netbsd.ports.sparc64
Message-ID <[email protected]>
Hi,

Setting "options MSGBUFSIZE" currently causes a compilation error because
MSGBUFSIZE is defined (but unused).  The attached allows MSGBUFSIZE to be
increased to 248K (253952).  Included are points that mrg@ mentioned -
AUXREG_VA and TMPMAP_VA aren't used on sparc64, and INTSTACK has been moved
by 192K (out of nearly 256M).

Comments?

Thanks,

J

PS.  I needed this because increasing the values of the USB-related debug
variables easily overruns 32K at boot.
-- 
  My other computer also runs NetBSD    /        Sailing at Newbiggin
        http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/
msgbuf.patch (text/plain, 1.8 KB)
--- src/sys/arch/sparc64/include/param.h.dist	2014-02-24 09:11:52.000000000 +0000
+++ src/sys/arch/sparc64/include/param.h	2014-03-26 20:52:32.000000000 +0000
@@ -168,13 +168,12 @@
 
 #define	_MAXNBPG	8192	/* fixed VAs, independent of actual NBPG */
 
-#define	AUXREG_VA	(      KERNEND + _MAXNBPG) /* 1 page REDZONE */
-#define	TMPMAP_VA	(    AUXREG_VA + _MAXNBPG)
-#define	MSGBUF_VA	(    TMPMAP_VA + _MAXNBPG)
+#define	MSGBUF_VA	(      KERNEND + _MAXNBPG) /* 1 page REDZONE */
 /*
+ * Maximum message buffer size is 192k.
  * Here's the location of the interrupt stack and CPU structure.
  */
-#define	INTSTACK	(      KERNEND + 8*_MAXNBPG)
+#define	INTSTACK	(      KERNEND + 32*_MAXNBPG)
 #define	EINTSTACK	(     INTSTACK + 4*_MAXNBPG)
 #define	CPUINFO_VA	(    EINTSTACK              )
 #define	PANICSTACK	(     INTSTACK + 8*_MAXNBPG)
@@ -197,7 +196,13 @@
 
 #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
 
-#define MSGBUFSIZE	NBPG
+#if !defined (MSGBUFSIZE)		/* options MSGBUFSIZE=integer	*/
+#define MSGBUFSIZE	4 * NBPG
+#else
+#if INTSTACK - MSGBUF_VA - MSGBUFSIZE < 0
+#error MSGBUFSIZE is too large
+#endif
+#endif
 
 /*
  * Minimum size of the kernel kmem_arena in PAGE_SIZE-sized
--- src/sys/arch/sparc64/sparc64/pmap.c.dist	2014-01-09 22:29:26.000000000 +0000
+++ src/sys/arch/sparc64/sparc64/pmap.c	2014-03-26 20:57:29.000000000 +0000
@@ -741,8 +741,7 @@
 	 * Get hold or the message buffer.
 	 */
 	msgbufp = (struct kern_msgbuf *)(vaddr_t)MSGBUF_VA;
-/* XXXXX -- increase msgbufsiz for uvmhist printing */
-	msgbufsiz = 4*PAGE_SIZE /* round_page(sizeof(struct msgbuf)) */;
+	msgbufsiz = MSGBUFSIZE /* round_page(sizeof(struct msgbuf)) */;
 	BDPRINTF(PDB_BOOT, ("Trying to allocate msgbuf at %lx, size %lx\n",
 			    (long)msgbufp, (long)msgbufsiz));
 	if ((long)msgbufp !=
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.