OSDN Git Service

reduce stack cache size to save memory space
authorWaldemar Brodkorb <wbx@openadk.org>
Thu, 17 Dec 2015 19:21:18 +0000 (20:21 +0100)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>
Thu, 17 Dec 2015 20:17:38 +0000 (21:17 +0100)
Idea from different projects as OpenWrt and others.
https://lists.openwrt.org/pipermail/openwrt-devel/2013-November/022299.html
https://github.com/wl500g/toolchain/blob/master/toolchain/uClibc/patches/0.9.32/980-stack-cache-maxsize.patch

libpthread/nptl/allocatestack.c

index 118820a..bf99252 100644 (file)
 
 /* Cache handling for not-yet free stacks.  */
 
-/* Maximum size in kB of cache.  */
-static size_t stack_cache_maxsize = 40 * 1024 * 1024; /* 40MiBi by default.  */
+/*
+   Maximum size in kB of cache. GNU libc default is 40MiB
+   embedded systems don't have enough ram for big dirty stack caches,
+   reduce it to 16MiB. 4 does not work, f.e. tst-kill4 segfaults.
+*/
+static size_t stack_cache_maxsize = 16 * 1024 * 1024;
 static size_t stack_cache_actsize;
 
 /* Mutex protecting this variable.  */