diff options
author | joerg <joerg@pkgsrc.org> | 2015-06-15 09:27:29 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2015-06-15 09:27:29 +0000 |
commit | e1aa58e8aa5d4e28296fb633ebc8aa0dd9f09977 (patch) | |
tree | 2908be8807320f2078df2d518c2e63aa3ea6d6ad /lang | |
parent | cc14af76caffd1015b22323a1df960b536566003 (diff) | |
download | pkgsrc-e1aa58e8aa5d4e28296fb633ebc8aa0dd9f09977.tar.gz |
Behave when address space limits are in place:
(1) Default heap limit to 75% of available address space.
(2) Limit GC marker threads to 4MB/8MB (32bit vs 64bit) stack space.
As Mono tries to create 16 such threads by default, the default
stack size on AMD64 would eat 2GB VA alone.
Bump revision.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/mono/Makefile | 4 | ||||
-rw-r--r-- | lang/mono/distinfo | 5 | ||||
-rw-r--r-- | lang/mono/patches/patch-ak | 27 | ||||
-rw-r--r-- | lang/mono/patches/patch-libgc_misc.c | 36 |
4 files changed, 65 insertions, 7 deletions
diff --git a/lang/mono/Makefile b/lang/mono/Makefile index b202d38d224..ff3aa1551a7 100644 --- a/lang/mono/Makefile +++ b/lang/mono/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.162 2015/06/12 10:50:16 wiz Exp $ +# $NetBSD: Makefile,v 1.163 2015/06/15 09:27:29 joerg Exp $ DISTNAME= mono-4.0.1 -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= lang MASTER_SITES= http://download.mono-project.com/sources/mono/ EXTRACT_SUFX= .tar.bz2 diff --git a/lang/mono/distinfo b/lang/mono/distinfo index b8bdba4bcaf..8cfd475a19c 100644 --- a/lang/mono/distinfo +++ b/lang/mono/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.103 2015/06/04 17:16:20 jperkin Exp $ +$NetBSD: distinfo,v 1.104 2015/06/15 09:27:29 joerg Exp $ SHA1 (mono-4.0.1.tar.bz2) = 9c7c27caa69e6a1673753437fd6824e0d33fe2ac RMD160 (mono-4.0.1.tar.bz2) = 3adcb49d7da9a4d81b7f5bc2108d13c20d94ab15 @@ -9,7 +9,7 @@ SHA1 (patch-ae) = 25869b98f9197243aea799b75b238d92f58e8845 SHA1 (patch-af) = 6a458a91dc34420d45238b5dad01ed63f0bd9e00 SHA1 (patch-ai) = d06c382d188f4263a2a505ca3d3ee491baa3af28 SHA1 (patch-aj) = 33b75ec2662cc442f602b21b03fee1e5c39e3a76 -SHA1 (patch-ak) = 919379dbf2a35c23010c87d9e95e124e8e84d04a +SHA1 (patch-ak) = 262845edcf84cf5127b7e01963f0d433aad7682a SHA1 (patch-al) = 07462d3f9cf2aa08b1fb837400084d32a7062eee SHA1 (patch-am) = ff0af9c120ebeb59edcdb727c7d36aa5939c73af SHA1 (patch-ap) = e0590d7014ae4ef74ee9f9c39f069411a66c8f76 @@ -40,6 +40,7 @@ SHA1 (patch-dj) = 049cc88dc523975404445f13de81255d75a22156 SHA1 (patch-dk) = ad78819e71f082d0b7f262c162d3a67cfdfdcf2f SHA1 (patch-dl) = dc63c1d3f6a1d78b2f5bb725cdff6824e2307dc5 SHA1 (patch-do) = 0bda0d2e482be218fb502e0c4ea945a41d078d27 +SHA1 (patch-libgc_misc.c) = 52c68e7b6f1b58f480286bd135591f97a3e13125 SHA1 (patch-man_mprof-report.1) = 0a80c164614cc9af5f01822005193d80f1d89946 SHA1 (patch-mono_dis_Makefile.in) = f000112e2712faf29104489e45feae8d6fc45169 SHA1 (patch-mono_metadata_icall.c) = 191a7fccb174855026cb11dd0f6ac450bb920ec7 diff --git a/lang/mono/patches/patch-ak b/lang/mono/patches/patch-ak index 60abd763702..8dd30c8de1f 100644 --- a/lang/mono/patches/patch-ak +++ b/lang/mono/patches/patch-ak @@ -1,5 +1,5 @@ -$NetBSD: patch-ak,v 1.11 2014/11/30 08:40:51 spz Exp $ ---- libgc/pthread_support.c.orig 2014-09-22 13:23:05.000000000 +0000 +$NetBSD: patch-ak,v 1.12 2015/06/15 09:27:29 joerg Exp $ +--- libgc/pthread_support.c.orig 2015-04-24 01:26:16.000000000 +0000 +++ libgc/pthread_support.c @@ -71,7 +71,7 @@ defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) || \ @@ -10,7 +10,28 @@ $NetBSD: patch-ak,v 1.11 2014/11/30 08:40:51 spz Exp $ # define USE_PTHREAD_SPECIFIC # endif #endif -@@ -1282,6 +1282,22 @@ void GC_end_blocking(void) { +@@ -595,6 +595,20 @@ static void start_mark_threads() + } + } + # endif /* HPUX || GC_DGUX386_THREADS */ ++# if defined(__NetBSD__) ++# define MAX_STACK_SIZE (1024 * 1024 *sizeof(word)) ++ { ++ size_t old_size; ++ int code; ++ ++ if (pthread_attr_getstacksize(&attr, &old_size) != 0) ++ ABORT("pthread_attr_getstacksize failed\n"); ++ if (old_size > MAX_STACK_SIZE) { ++ if (pthread_attr_setstacksize(&attr, MAX_STACK_SIZE) != 0) ++ ABORT("pthread_attr_setstacksize failed\n"); ++ } ++ } ++# endif + # ifdef CONDPRINT + if (GC_print_stats) { + GC_printf1("Starting %ld marker threads\n", GC_markers - 1); +@@ -1282,6 +1296,22 @@ void GC_end_blocking(void) { #define __d10_sleep sleep #endif /* GC_DGUX386_THREADS */ diff --git a/lang/mono/patches/patch-libgc_misc.c b/lang/mono/patches/patch-libgc_misc.c new file mode 100644 index 00000000000..5d69eca69c8 --- /dev/null +++ b/lang/mono/patches/patch-libgc_misc.c @@ -0,0 +1,36 @@ +$NetBSD: patch-libgc_misc.c,v 1.1 2015/06/15 09:27:29 joerg Exp $ + +--- libgc/misc.c.orig 2015-06-13 23:08:46.000000000 +0000 ++++ libgc/misc.c +@@ -14,10 +14,10 @@ + */ + /* Boehm, July 31, 1995 5:02 pm PDT */ + +- + #include <stdio.h> + #include <limits.h> + #ifndef _WIN32_WCE ++#include <sys/resource.h> + #include <signal.h> + #endif + +@@ -766,6 +766,19 @@ void GC_init_inner() + initial_heap_sz = divHBLKSZ(initial_heap_sz); + } + } ++#ifdef RLIMIT_AS ++ { ++ /* ++ * If there is a VA limit for the process, ++ * keep the heap under 75% if that limit. ++ */ ++ struct rlimit lim; ++ if (!getrlimit(RLIMIT_AS, &lim)) { ++ if (lim.rlim_cur != RLIM_INFINITY && lim.rlim_cur == (word)lim.rlim_cur) ++ GC_set_max_heap_size(lim.rlim_cur / 2 + lim.rlim_cur / 4); ++ } ++ } ++#endif + { + char * sz_str = GETENV("GC_MAXIMUM_HEAP_SIZE"); + if (sz_str != NULL) { |