From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Tue, 26 Feb 2019 12:12:54 +0300 From: Cyrill Gorcunov Subject: Re: [RFC v3] fiber: Increase default stack size Message-ID: <20190226091254.GL7198@uranus> References: <20190222201639.GA7198@uranus> <20190225145516.6fdmob3tdkft5sky@esperanza> <20190225213955.GI7198@uranus> <20190226085852.ugkqo6dz5nmjbhze@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190226085852.ugkqo6dz5nmjbhze@esperanza> To: Vladimir Davydov Cc: =?utf-8?B?0JPQtdC+0YDQs9C40Lkg0JrQuNGA0LjRh9C10L3QutC+?= , tarantool-patches@freelists.org List-ID: On Tue, Feb 26, 2019 at 11:58:52AM +0300, Vladimir Davydov wrote: ... > > > > https://github.com/tarantool/tarantool/issues/3418 > > Forgot to tell you during the previous review round: we don't put a full > link in the commit message. Instead we write: > > Closes #3418 OK > > We put the link after the diff separator (---) so as a reviewer can > easily open it. > > > --- > > Vladimir, take a look please. That is what you mean? > > Yes. > > > I'm not yet familiar with slab engine, does it allocates > > pages on lazy fashion or we need to pass 'dontneed' on > > first fiber creation too? > > Oops, you're right, good catch! The allocator may poison slab if NDEBUG > is unset. So we can either > > - Madvise slab on fiber creation, at least in NDEBUG mode. Simple, but > depends on the allocator internals. > - Patch the 'small' library to make the allocator do madvise for us. > IMO it would look better, but would clutter the allocator API. > - Don't use 'small' allocator at all for default slab allocations, and > simply mmap stack and link them in a free list (is it OK to mmap a > few MB chunk per each fiber?). > > I'm inclined to choose the last option. I'll discuss the options with > others today and follow-up. Will continue at the evening. Also note that stack is special and we better should not pass arbitrary sizes to allocate even for custom stacks, they all _must_ be PAGE_SIZE aligned (or call it PAGE_SIZE orders if you prefer :) Anything else make madvise idea useless since kernel requires madvise args to be page aligned which is understandable due to hardware. > > > > Also should not we give user a way to configure this early > > params, maybe via getenv? > > May be, but this can definitely be done later if we really need it. OK