linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Hong Zhiguo <honkiko@gmail.com>
Cc: tj@kernel.org, cgroups@vger.kernel.org, axboe@kernel.dk,
	linux-kernel@vger.kernel.org,
	Hong Zhiguo <zhiguohong@tencent.com>
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@tencent.com>

On Sun, Oct 20, 2013 at 08:11:12PM +0800, Hong Zhiguo wrote:
> From: Hong Zhiguo <zhiguohong@tencent.com>
> 
> 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

  reply	other threads:[~2013-10-22 21:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1381574794-7639-1-git-send-email-zhiguohong@tencent.com>
2013-10-14  9:09 ` [PATCH v2] blk-throttle: simplify logic by token bucket algorithm Hong Zhiguo
2013-10-14 13:36   ` Tejun Heo
2013-10-14 13:47     ` Hong zhi guo
2013-10-14 13:53     ` Hong zhi guo
2013-10-14 13:59       ` Tejun Heo
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
2013-10-16 16:22           ` Vivek Goyal
2013-10-17 12:17 ` [PATCH v3] " Hong Zhiguo
2013-10-18 15:55   ` Vivek Goyal
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
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
2013-10-22 21:02         ` Vivek Goyal [this message]
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@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=honkiko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=zhiguohong@tencent.com \
    /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).