Date: Wed, 24 Sep 2014 12:39:13 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272069 - head/lib/libthr/thread Message-ID: <201409241239.s8OCdDSq058741@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Sep 24 12:39:12 2014 New Revision: 272069 URL: http://svnweb.freebsd.org/changeset/base/272069 Log: Switch the defaults to not split the RLIMIT_STACK-sized initial thread stack into the stacks of the created threads. Add knob LIBPTHREAD_SPLITSTACK_MAIN to restore the older behaviour. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/lib/libthr/thread/thr_init.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Wed Sep 24 12:19:00 2014 (r272068) +++ head/lib/libthr/thread/thr_init.c Wed Sep 24 12:39:12 2014 (r272069) @@ -445,7 +445,7 @@ init_private(void) struct rlimit rlim; size_t len; int mib[2]; - char *env; + char *env, *env_bigstack, *env_splitstack; _thr_umutex_init(&_mutex_static_lock); _thr_umutex_init(&_cond_static_lock); @@ -473,8 +473,9 @@ init_private(void) len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) PANIC("Cannot get kern.usrstack from sysctl"); - env = getenv("LIBPTHREAD_BIGSTACK_MAIN"); - if (env != NULL) { + env_bigstack = getenv("LIBPTHREAD_BIGSTACK_MAIN"); + env_splitstack = getenv("LIBPTHREAD_SPLITSTACK_MAIN"); + if (env_bigstack != NULL || env_splitstack == NULL) { if (getrlimit(RLIMIT_STACK, &rlim) == -1) PANIC("Cannot get stack rlimit"); _thr_stack_initial = rlim.rlim_cur;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409241239.s8OCdDSq058741>