Re: maxdsiz tweaking

Previous thread: Download Mobile Spy Software by Mobile Spy Software on Saturday, November 27, 2010 - 3:23 pm. (1 message)

Next thread: Re: CVS: cvs.openbsd.org: src by Philip Guenther on Sunday, November 28, 2010 - 5:26 pm. (5 messages)
From: Ted Unangst
Date: Sunday, November 28, 2010 - 4:51 pm

What follows is a somewhat older mail I had forgotten about.  It's 
suddenly become more interesting to be because I was playing around with 
jruby which requires a big heap size.  It pisses me off to own a 3GB 
laptop and only be able to use 1GB of that memory.

This does 2.5 things.

1.  If uvm_mmap fails to find memory in the normal mmap area, go back
again and look for memory somewhere else (brk).  We only do this after
failure, to preserve the brk space as long as possible.

2.  Distinguish the two meanings of MAXDSIZ.  Use BRKSIZ in more places (I
think this technically fixes a bug on vax) and add it to i386.

2.5.  Up i386 MAXDSIZ to 2G.

End effect:  You can fsck a much larger filesystem now.  This doesn't
change memory layout or allocation policy for any existing program, but
will let you throw more memory at programs that don't currently run.

Index: arch/i386/include/vmparam.h
===================================================================
RCS file: /cvs/src/sys/arch/i386/include/vmparam.h,v
retrieving revision 1.43
diff -u -r1.43 vmparam.h
--- arch/i386/include/vmparam.h	16 Jun 2009 16:42:41 -0000	1.43
+++ arch/i386/include/vmparam.h	30 Jun 2010 02:17:34 -0000
@@ -63,7 +63,10 @@
 #define	DFLDSIZ		(64*1024*1024)		/* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define	MAXDSIZ		(1024*1024*1024)	/* max data size */
+#define	MAXDSIZ		(2U*1024*1024*1024 - 4096)	/* max data size */
+#endif
+#ifndef BRKSIZ
+#define BRKSIZ		(1024*1024*1024)
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(4*1024*1024)		/* initial stack size limit */
Index: compat/svr4/svr4_misc.c
===================================================================
RCS file: /cvs/src/sys/compat/svr4/svr4_misc.c,v
retrieving revision 1.54
diff -u -r1.54 svr4_misc.c
--- compat/svr4/svr4_misc.c	25 May 2010 16:39:15 -0000	1.54
+++ compat/svr4/svr4_misc.c	30 Jun 2010 02:17:35 -0000
@@ -370,7 +370,7 @@
 	SCARG(&mm, addr) = SCARG(uap, addr);
 	SCARG(&mm, pos) = SCARG(uap, pos);
 
-	rp = ...
From: Landry Breuil
Date: Monday, November 29, 2010 - 12:46 am

Or probably allows one to build debug-enabled monsters like firefox^Wmozilla
or webkit on i386.. which currently ld fails to link due to object sizes.
if so, i'd welcome that.

Landry

From: Miod Vallat
Date: Thursday, December 2, 2010 - 2:27 pm

The way this is written, invadeheap will never have any effect on vax.
Shouldn't this become something like:

	addr = ...
	if (!invadeheap)
		addr +=
#if !defined(__vax__)
	addr += randomness
#endif

Miod

Previous thread: Download Mobile Spy Software by Mobile Spy Software on Saturday, November 27, 2010 - 3:23 pm. (1 message)

Next thread: Re: CVS: cvs.openbsd.org: src by Philip Guenther on Sunday, November 28, 2010 - 5:26 pm. (5 messages)