From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 13 Mar 2019 16:42:53 +0300 From: Vladimir Davydov Subject: Re: [PATCH 1/3] lib/core/fiber: Increase default stack size Message-ID: <20190313134253.iihpk6ej7dx7a5rx@esperanza> References: <20190312224721.8053-1-gorcunov@gmail.com> <20190312224721.8053-2-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190312224721.8053-2-gorcunov@gmail.com> To: Cyrill Gorcunov Cc: tml List-ID: On Wed, Mar 13, 2019 at 01:47:19AM +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 512K which should fit May be, better use 1 MB, just to be sure? > for common case. Later we will make this value configurable > to address arbitrary stack sizes without a need to rebuild > the whole 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 Should be "Part of #3418". We use "Closes" only with the last patch in the series (it makes GitHub close the issue). > --- > src/lib/core/fiber.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c > index abd6c6b11..f16ac873f 100644 > --- a/src/lib/core/fiber.c > +++ b/src/lib/core/fiber.c > @@ -93,9 +93,9 @@ static int stack_direction; > > enum { > /* The minimum allowable fiber stack size in bytes */ > - FIBER_STACK_SIZE_MINIMAL = 16384, > + FIBER_STACK_SIZE_MINIMAL = 4 << 12, > /* Default fiber stack size in bytes */ > - FIBER_STACK_SIZE_DEFAULT = 65536 > + FIBER_STACK_SIZE_DEFAULT = 128 << 12 I don't like using '<< 12' for stack sizes. Why 12? Because the page size is typically 4K. I wouldn't count on that - it's userspace so it looks confusing.