From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Message-Id: <20190302130033.888921573@gmail.com> Date: Sat, 02 Mar 2019 15:55:25 +0300 From: Cyrill Gorcunov Subject: [rfc 1/4] core/fiber: Increase default stack size References: <20190302125524.279852704@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=fiber-increase-stack To: tarantool-patches@freelists.org Cc: gorcunov@gmail.com, vdavydov.dev@gmail.com List-ID: The default 64K stack size used for years become too small for modern distors (Fedora 29 and etc) where third party libraries (such as ncurses) started to use 64K for own buffers and we get SIGSGV early without reaching interactive console phase. Thus we increase default size up to 256K which should fit for common case. Later we will make this value configurable to address arbitrary stack sizes without a need to rebuild the code. Note the values are switched to 4K page granularity for sake of future modifications -- we gonna manipulate pages to relax rss usage if OS allows. Closes #3418 --- src/lib/core/fiber.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: tarantool.git/src/lib/core/fiber.c =================================================================== --- tarantool.git.orig/src/lib/core/fiber.c +++ tarantool.git/src/lib/core/fiber.c @@ -92,10 +92,10 @@ static size_t page_size; static int stack_direction; enum { - /* The minimum allowable fiber stack size in bytes */ - FIBER_STACK_SIZE_MINIMAL = 16384, - /* Default fiber stack size in bytes */ - FIBER_STACK_SIZE_DEFAULT = 65536 + /* The minimum allowable fiber stack size in 4K page */ + FIBER_STACK_SIZE_MINIMAL = 4 << 12, + /* Default fiber stack size in 4K page */ + FIBER_STACK_SIZE_DEFAULT = 64 << 12, }; /** Default fiber attributes */