Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org, kostja@tarantool.org
Subject: Re: [PATCH 3/3] core/fiber: Put watermarks into stack to track its usage
Date: Thu, 7 Mar 2019 12:04:39 +0300	[thread overview]
Message-ID: <20190307090439.GE10420@uranus.lan> (raw)
In-Reply-To: <20190307082758.qywkiey7y5hudcpv@esperanza>

On Thu, Mar 07, 2019 at 11:27:58AM +0300, Vladimir Davydov wrote:
...
> 
> You can track the ratio of fibers that have overwritten the watermark
> recently. If the ratio gets too high (say 90% out of 1000 recently
> scheduled fibers), the minimal stack allocation should be increased.

IOW, we need to gather statistics :/ I would rather splt this task
into two:

 - make stack 1M by default and madvise as not needed and merge,
   it upstream asap, to not block users

 - second series is to optimize stack usage

> > 
> > This won't work. Imagine we put wmark in _first_ page, and then we find
> > that the wmark has been overwriten, where to put next mark then? Or
> > you propose to catch signals?
> 
> Put the next watermark in the second page then. If it gets overwritten,
> too, put it in the third page, and so on. Perhaps, we can even double
> the minimal stack allocation each time.

ok

> > > 
> > > Why not rand?
> > 
> > Because we already have a helper for random numbers :)
> 
> It's a helper for filling an array with random bytes. I don't see much
> point in using it for generating a single random number.

ok

	Cyrill

  reply	other threads:[~2019-03-07  9:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 22:38 [PATCH v3 0/3] core/fiber: Rework stack management Cyrill Gorcunov
2019-03-05 22:38 ` [PATCH 1/3] core/fiber: Increase default stack size Cyrill Gorcunov
2019-03-05 23:43   ` [tarantool-patches] " Alexander Turenko
2019-03-06  7:09     ` Cyrill Gorcunov
2019-03-06  7:30     ` Konstantin Osipov
2019-03-05 22:38 ` [PATCH 2/3] core/fiber: Mark stack as unneeded on creation Cyrill Gorcunov
2019-03-05 22:38 ` [PATCH 3/3] core/fiber: Put watermarks into stack to track its usage Cyrill Gorcunov
2019-03-06 18:05   ` Vladimir Davydov
2019-03-06 19:03     ` Cyrill Gorcunov
2019-03-07  8:27       ` Vladimir Davydov
2019-03-07  9:04         ` Cyrill Gorcunov [this message]
2019-03-07  9:20           ` Vladimir Davydov

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=20190307090439.GE10420@uranus.lan \
    --to=gorcunov@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH 3/3] core/fiber: Put watermarks into stack to track its usage' \
    /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