Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/include PR 32999: adjust VM parameters for ...



details:   https://anonhg.NetBSD.org/src/rev/241981f25a0e
branches:  trunk
changeset: 341651:241981f25a0e
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 15 20:35:33 2015 +0000

description:
PR 32999: adjust VM parameters for 64 bit kernel/userlands.
Limit old binaries (i.e. processes not using topdown VA layout) to 2 GB
data size.
Use the same limits as native sparc for netbsd32 emulation - we need to
revisit this, but currently automatic test runs in this environment
fail big time, so there is no easy way to verify any changes.

diffstat:

 sys/arch/sparc64/include/vmparam.h |  42 ++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 19 deletions(-)

diffs (105 lines):

diff -r 25bdad34e2cb -r 241981f25a0e sys/arch/sparc64/include/vmparam.h
--- a/sys/arch/sparc64/include/vmparam.h        Sun Nov 15 19:44:31 2015 +0000
+++ b/sys/arch/sparc64/include/vmparam.h        Sun Nov 15 20:35:33 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam.h,v 1.34 2014/04/14 10:54:08 martin Exp $ */
+/*     $NetBSD: vmparam.h,v 1.35 2015/11/15 20:35:33 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,8 +78,7 @@
 /*
  * Virtual memory related constants, all in bytes
  */
-/* #ifdef __arch64__ */
-#if 0
+#if __arch64__
 /*
  * 64-bit limits:
  *
@@ -90,64 +89,69 @@
  * of that for data and the other half for stack.
  */
 #ifndef MAXTSIZ
-#define        MAXTSIZ         (4L*1024*1024*1024)     /* max text size */
+#define        MAXTSIZ         (4UL*1024*1024*1024)    /* max text size */
 #endif
 #ifndef DFLDSIZ
-#define        DFLDSIZ         (128L*1024*1024)        /* initial data size limit */
+#define        DFLDSIZ         (128UL*1024*1024)       /* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define        MAXDSIZ         (1L<<39)                /* max data size */
+#define        MAXDSIZ         (1UL<<39)               /* max data size */
+/*
+ * For processes not using topdown VA, we need to limit the data size -
+ * they probably have not been compiled with the proper compiler memory
+ * model.
+ */
+#define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
+    round_page((vaddr_t)(da) + (vsize_t)max(maxdmap,2UL*1024*1024*1024))
 #endif
 #ifndef        DFLSSIZ
 #define        DFLSSIZ         (2*1024*1024)           /* initial stack size limit */
 #endif
 #ifndef        MAXSSIZ
-#define        MAXSSIZ         MAXDSIZ                 /* max stack size */
+#define        MAXSSIZ         (128*1024*1024)         /* max stack size */
 #endif
 #else
 /*
  * 32-bit limits:
  *
- * We only have 4GB to play with.  Limit stack, data, and text
- * each to half of that.
+ * We only have 4GB to play with.  Limit data, and text
+ * each to half of that and set a reasonable stack limit.
  *
- * This is silly.  Apparently if we go above these numbers
- * integer overflows in other parts of the kernel cause hangs.
  */
 #ifndef MAXTSIZ
-#define        MAXTSIZ         (1*1024*1024*1024)      /* max text size */
+#define        MAXTSIZ         (2UL*1024*1024*1024)    /* max text size */
 #endif
 #ifndef DFLDSIZ
 #define        DFLDSIZ         (128*1024*1024)         /* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define        MAXDSIZ         (1*1024*1024*1024)      /* max data size */
+#define        MAXDSIZ         (2UL*1024*1024*1024)    /* max data size */
 #endif
 #ifndef        DFLSSIZ
 #define        DFLSSIZ         (2*1024*1024)           /* initial stack size limit */
 #endif
 #ifndef        MAXSSIZ
-#define        MAXSSIZ         (8*1024*1024)                   /* max stack size */
+#define        MAXSSIZ         (64*1024*1024)          /* max stack size */
 #endif
 #endif
 
 /*
- * 32-bit emulation limits.
+ * 32-bit emulation limits (same as sparc - we could go bigger)
  */
 #ifndef MAXTSIZ32
-#define        MAXTSIZ32       (1*1024*1024*1024)      /* max text size */
+#define        MAXTSIZ32       (64*1024*1024)          /* max text size */
 #endif
 #ifndef DFLDSIZ32
-#define        DFLDSIZ32       (128*1024*1024)         /* initial data size limit */
+#define        DFLDSIZ32       (64*1024*1024)          /* initial data size limit */
 #endif
 #ifndef MAXDSIZ32
-#define        MAXDSIZ32       (1*1024*1024*1024)      /* max data size */
+#define        MAXDSIZ32       (512*1024*1024)         /* max data size */
 #endif
 #ifndef        DFLSSIZ32
 #define        DFLSSIZ32       (2*1024*1024)           /* initial stack size limit */
 #endif
 #ifndef        MAXSSIZ32
-#define        MAXSSIZ32       (8*1024*1024)                   /* max stack size */
+#define        MAXSSIZ32       (32*1024*1024)          /* max stack size */
 #endif
 
 /*



Home | Main Index | Thread Index | Old Index