From: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Hong Zhiguo <honkiko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Hong Zhiguo <zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH v4 2/2] blk-throttle: trim tokens generated for an idle tree
Date: Tue, 22 Oct 2013 17:02:32 -0400 [thread overview]
Message-ID: <20131022210232.GB2884@redhat.com> (raw)
In-Reply-To: <1382271072-15664-3-git-send-email-zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
On Sun, Oct 20, 2013 at 08:11:12PM +0800, Hong Zhiguo wrote:
> From: Hong Zhiguo <zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
>
> Why
> ====
> Pointed out by Vivek: Tokens generated during idle period should
> be trimmed. Otherwise a huge bio may be permited immediately.
> Overlimit behaviour may be observed during short I/O throughput
> test.
>
> Vivek also pointed out: We should not over-trim for hierarchical
> groups. Suppose a subtree of groups are idle when a big bio comes.
> The token of the child group is trimmed and not enough. So the bio is
> queued on the child group. After some jiffies the child group reserved
> enough tokens and the bio climbs up. If we trim the parent group at
> this time again, this bio will wait too much time than expected.
>
> Analysis
> ========
> When the bio is queued on child group, all it's ancestor groups
> becomes non-idle. They should start to reserve tokens for that
> bio from this moment. And their reserved tokens before should be
> trimmed at this moment.
>
> How
> ====
> service_queue now has a new member nr_queued_tree[2], to represent
> the the number of bios waiting on the subtree rooted by this sq.
>
> When a bio is queued on the hierarchy first time, nr_queued_tree
> of all ancestors and the child group itself are increased. When a
> bio climbs up, nr_queued_tree of the child group is decreased.
>
> When nr_queued_tree turns from zero to one, the tokens reserved
> before are trimmed. And after this switch, this group will never
> be trimmed to reserve tokens for the bio waiting on it's descendant
> group.
>
Hi Hong,
This approach looks good in general. Only downside I can think of
updation of nr_requests throughout the hierarchy. So deeper the
hierarchy, higher the overhead.
I am not sure if that's a concern or not. I will have a closer look
a the patches tomorrow and do some testing too.
Thanks
Vivek
next prev parent reply other threads:[~2013-10-22 21:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-12 10:46 [PATCH] blk-throttle: simplify logic by token bucket algorithm Hong Zhiguo
[not found] ` <1381574794-7639-1-git-send-email-zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2013-10-13 12:59 ` Hong zhi guo
2013-10-14 9:09 ` [PATCH v2] " Hong Zhiguo
[not found] ` <1381741757-20888-1-git-send-email-zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2013-10-14 13:36 ` Tejun Heo
2013-10-14 13:47 ` Hong zhi guo
[not found] ` <20131014133620.GF4722-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-10-14 13:53 ` Hong zhi guo
[not found] ` <CAA7+ByWPM2Pizm+dP1AxPM7Ut-w=AtRfD2GkCK-0OVh+C2Twkg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-14 13:59 ` Tejun Heo
[not found] ` <20131014135929.GH4722-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-10-15 12:35 ` Hong zhi guo
2013-10-15 16:19 ` Jens Axboe
2013-10-15 13:03 ` Vivek Goyal
2013-10-15 17:32 ` Vivek Goyal
2013-10-16 6:09 ` Hong zhi guo
2013-10-16 14:14 ` Vivek Goyal
2013-10-16 15:47 ` Hong zhi guo
2013-10-16 15:53 ` Tejun Heo
[not found] ` <20131016155344.GA10012-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-10-16 16:22 ` Vivek Goyal
2013-10-16 16:22 ` Hong zhi guo
2013-10-17 12:17 ` [PATCH v3] " Hong Zhiguo
[not found] ` <1382012272-26170-1-git-send-email-zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2013-10-18 15:55 ` Vivek Goyal
[not found] ` <20131018155532.GD2277-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-10-20 12:08 ` Hong zhi guo
2013-10-20 12:11 ` [PATCH v4 0/2] " Hong Zhiguo
2013-10-20 12:11 ` [PATCH v4 1/2] " Hong Zhiguo
2014-04-10 10:07 ` Hong zhi guo
[not found] ` <CAA7+ByVJWjfs5HiMsnuum75egghrNQHt2KNNPTWeVa0-FWccaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-10 13:32 ` Vivek Goyal
2013-10-20 12:11 ` [PATCH v4 2/2] blk-throttle: trim tokens generated for an idle tree Hong Zhiguo
[not found] ` <1382271072-15664-3-git-send-email-zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2013-10-22 21:02 ` Vivek Goyal [this message]
[not found] ` <20131022210232.GB2884-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-10-23 3:30 ` Hong zhi guo
2013-10-28 5:08 ` Hong zhi guo
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=20131022210232.GB2884@redhat.com \
--to=vgoyal-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=honkiko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).