From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH 05/18] vinyl: wake up fibers waiting for quota one by one
Date: Fri, 24 Aug 2018 11:33:06 +0300 [thread overview]
Message-ID: <20180824083306.o7gb5colm4rxhjrc@esperanza> (raw)
In-Reply-To: <20180820111123.GH8716@chai>
On Mon, Aug 20, 2018 at 02:11:23PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev@gmail.com> [18/08/16 23:03]:
> > Currently, we wake up all fibers whenever we free some memory. This
> > is inefficient, because it might occur that all available quota gets
> > consumed by a few fibers while the rest will have to go back to sleep.
> > This is also kinda unfair, because waking up all fibers breaks the order
> > in which the fibers were put to sleep. This works now, because we free
> > memory and wake up fibers infrequently (on dump) and there normally
> > shouldn't be any fibers waiting for quota (if there were, the latency
> > would rocket sky high because of absence of any kind of throttling).
> > However, once throttling is introduced, fibers waiting for quota will
> > become the norm. So let's wake up fibers one by one: whenever we free
> > memory we wake up the first fiber in the line, which will wake up the
> > next fiber on success and so forth.
> > +
> > + /* Wake up the next fiber in the line waiting for quota. */
> > + fiber_cond_signal(&q->cond);
> > return 0;
>
> Please only wake up the next fiber if there is one, or, better
> yet, if this fiber had been put to sleep and then was woken up.
I don't quite understand what you mean - fiber_cond_signal() will do
nothing if there's no fiber waiting on it.
next prev parent reply other threads:[~2018-08-24 8:33 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-16 16:11 [PATCH 00/18] Implement write throttling for vinyl Vladimir Davydov
2018-08-16 16:11 ` [PATCH 01/18] vinyl: rework internal quota API Vladimir Davydov
2018-08-20 11:07 ` Konstantin Osipov
2018-08-24 8:32 ` Vladimir Davydov
2018-08-27 18:29 ` Vladimir Davydov
2018-08-16 16:11 ` [PATCH 02/18] vinyl: move quota methods implementation to vy_quota.c Vladimir Davydov
2018-08-20 11:07 ` Konstantin Osipov
2018-08-27 18:30 ` Vladimir Davydov
2018-08-16 16:11 ` [PATCH 03/18] vinyl: move quota related methods and variables from vy_env to vy_quota Vladimir Davydov
2018-08-20 11:08 ` Konstantin Osipov
2018-08-27 18:33 ` Vladimir Davydov
2018-08-16 16:11 ` [PATCH 04/18] vinyl: implement vy_quota_wait using vy_quota_try_use Vladimir Davydov
2018-08-20 11:09 ` Konstantin Osipov
2018-08-27 18:36 ` Vladimir Davydov
2018-08-16 16:11 ` [PATCH 05/18] vinyl: wake up fibers waiting for quota one by one Vladimir Davydov
2018-08-20 11:11 ` Konstantin Osipov
2018-08-24 8:33 ` Vladimir Davydov [this message]
2018-08-28 13:19 ` Vladimir Davydov
2018-08-28 14:04 ` Konstantin Osipov
2018-08-28 14:39 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 06/18] vinyl: do not wake up fibers waiting for quota if quota is unavailable Vladimir Davydov
2018-08-20 11:13 ` Konstantin Osipov
2018-08-16 16:12 ` [PATCH 07/18] vinyl: tune dump bandwidth histogram buckets Vladimir Davydov
2018-08-20 11:15 ` Konstantin Osipov
2018-08-28 15:37 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 08/18] vinyl: rename vy_quota::dump_bw to dump_bw_hist Vladimir Davydov
2018-08-20 11:15 ` Konstantin Osipov
2018-08-28 16:04 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 09/18] vinyl: cache dump bandwidth for timer invocation Vladimir Davydov
2018-08-20 11:21 ` Konstantin Osipov
2018-08-28 16:10 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 10/18] vinyl: do not add initial guess to dump bandwidth histogram Vladimir Davydov
2018-08-20 11:23 ` Konstantin Osipov
2018-08-23 20:15 ` Konstantin Osipov
2018-08-28 16:15 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 11/18] vinyl: use snap_io_rate_limit for initial dump bandwidth estimate Vladimir Davydov
2018-08-20 11:24 ` Konstantin Osipov
2018-08-24 8:31 ` Vladimir Davydov
2018-08-28 16:18 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 12/18] histogram: add function for computing lower bound percentile estimate Vladimir Davydov
2018-08-20 11:29 ` [tarantool-patches] " Konstantin Osipov
2018-08-24 8:30 ` Vladimir Davydov
2018-08-28 16:39 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 13/18] vinyl: use lower bound percentile estimate for dump bandwidth Vladimir Davydov
2018-08-28 16:51 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 14/18] vinyl: do not try to trigger dump if it is already in progress Vladimir Davydov
2018-08-16 16:12 ` [PATCH 15/18] vinyl: improve dump start/stop logging Vladimir Davydov
2018-08-23 20:18 ` Konstantin Osipov
2018-08-16 16:12 ` [PATCH 16/18] vinyl: confine quota watermark within sane value range Vladimir Davydov
2018-08-16 16:12 ` [PATCH 17/18] vinyl: set quota timer period to 100 ms Vladimir Davydov
2018-08-23 20:49 ` Konstantin Osipov
2018-08-24 8:18 ` Vladimir Davydov
2018-08-16 16:12 ` [PATCH 18/18] vinyl: throttle tx rate if dump does not catch up Vladimir Davydov
2018-08-23 20:54 ` Konstantin Osipov
2018-08-23 20:58 ` [tarantool-patches] " Konstantin Osipov
2018-08-24 8:21 ` 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=20180824083306.o7gb5colm4rxhjrc@esperanza \
--to=vdavydov.dev@gmail.com \
--cc=kostja@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [PATCH 05/18] vinyl: wake up fibers waiting for quota one by one' \
/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