From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 6 Mar 2019 10:30:15 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH 1/3] core/fiber: Increase default stack size Message-ID: <20190306073015.GB17432@chai> References: <20190305223854.14660-1-gorcunov@gmail.com> <20190305223854.14660-2-gorcunov@gmail.com> <20190305234336.rwffevewm4ooqun3@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190305234336.rwffevewm4ooqun3@tkn_work_nb> To: Alexander Turenko Cc: Cyrill Gorcunov , tarantool-patches@freelists.org, vdavydov.dev@gmail.com List-ID: * Alexander Turenko [19/03/06 10:24]: Alexander, we plan to make the default stack size configurable. > On Wed, Mar 06, 2019 at 01:38:52AM +0300, Cyrill Gorcunov wrote: > > 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(-) > > > > diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c > > index abd6c6b11..d4d16c05e 100644 > > --- a/src/lib/core/fiber.c > > +++ b/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, > > I recently looked at #3564 and observed that 256 KiB of stack is not > enough for our http client (the wrapper around libcurl). I bisected how > much it requeres and found that it fails with 448 KiB, but succeeds with > 480 KiB. I just tried the following case with different > FIBER_STACK_SIZE_DEFAULT constants on our tt-mac machine: > > ./src/tar -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov