Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tml <tarantool-patches@freelists.org>,
	Konstantin Osipov <kostja@tarantool.org>
Subject: Re: [PATCH 2/2] lib/core/fiber: Mark stack as unneeded on creation
Date: Mon, 11 Mar 2019 11:31:26 +0300	[thread overview]
Message-ID: <20190311083126.GG10420@uranus.lan> (raw)
In-Reply-To: <20190311081814.lq3ginhx3rayjwul@esperanza>

On Mon, Mar 11, 2019 at 11:18:14AM +0300, Vladimir Davydov wrote:
> > diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c
> > index f16ac873f..a1b261ad4 100644
> > --- a/src/lib/core/fiber.c
> > +++ b/src/lib/core/fiber.c
> > @@ -749,6 +749,14 @@ fiber_stack_create(struct fiber *fiber, size_t stack_size)
> >  	fiber->stack_id = VALGRIND_STACK_REGISTER(fiber->stack,
> >  						  (char *)fiber->stack +
> >  						  fiber->stack_size);
> > +#ifndef TARGET_OS_DARWIN
> > +	/*
> > +	 * We don't expect the whole stack usage in regular
> > +	 * loads, lets try to minimize rss pressure if OS
> > +	 * allows us.
> > +	 */
> > +	madvise(fiber->stack, fiber->stack_size, MADV_DONTNEED);
> > +#endif
> 
> madvise on fiber creation doesn't make much sense without madvise on
> fiber recycling, because fat tasks will quickly fault-in that memory.
> I thought you were going to implement stack shrinking to some predefined
> size (say, allocate 1 MB max, shrink to 64 KB on recycle if watermark
> was overwritten), leaving only dynamic stack sizing for the future (i.e.
> estimating the optimal size to do madvise for basing on average fiber
> stack usage).

Ah. OK, will rework this.

      reply	other threads:[~2019-03-11  8:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 21:31 [PATCH v4 0/2] lib/core/fiber: Increase default stack size Cyrill Gorcunov
2019-03-07 21:31 ` [PATCH 1/2] " Cyrill Gorcunov
2019-03-07 21:31 ` [PATCH 2/2] lib/core/fiber: Mark stack as unneeded on creation Cyrill Gorcunov
2019-03-11  8:18   ` Vladimir Davydov
2019-03-11  8:31     ` Cyrill Gorcunov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311083126.GG10420@uranus.lan \
    --to=gorcunov@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH 2/2] lib/core/fiber: Mark stack as unneeded on creation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox