cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hong Zhiguo <honkiko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org,
	Hong Zhiguo <zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH 0/2] blk-throttle: simplify logic by token bucket algorithm
Date: Tue, 15 Apr 2014 15:18:21 +0800	[thread overview]
Message-ID: <1397546303-6709-1-git-send-email-zhiguohong@tencent.com> (raw)

From: Hong Zhiguo <zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>

Based on the discussion with Vivek, Tejun and Jens.

Patch 1/2 implements basic token bucket rate limiting for blk-throttle.
Patch 2/2 adjusts some behavior for the cases pointed out by Vivek:
	- A huge bio may be allowed immediately after a long time of idle
	- When token is trimmed for above case, should not trim ancestors
	  when bio climbs up, instead, trim ancestors when bio is queued
	  on lowest child group.

Trimming of iops token is not necessary. Since a bio always costs _one_ 
iops token. Trimming it won't change the fact that current iops token is
zero or not.

Thanks Vivek for the ancestor over-trim issue and the proposed solution.
I took another method inspired by Vivek's comments but I think more decent.
Please help to review it.

Hong Zhiguo (2):
  blk-throttle: simplify logic by token bucket algorithm
  blk-throttle: trim tokens generated for an idle tree

 block/blk-throttle.c | 314 ++++++++++++++-------------------------------------
 1 file changed, 84 insertions(+), 230 deletions(-)

-- 
1.8.1.2

             reply	other threads:[~2014-04-15  7:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15  7:18 Hong Zhiguo [this message]
     [not found] ` <1397546303-6709-1-git-send-email-zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2014-04-15  7:18   ` [PATCH 1/2] blk-throttle: simplify logic by token bucket algorithm Hong Zhiguo
2014-04-15  7:18   ` [PATCH 2/2] blk-throttle: trim tokens generated for an idle tree Hong Zhiguo
2014-04-15  7:23   ` Test of [PATCH] blk-throttle: simplify logic by token bucket algorithm Hong Zhiguo
     [not found]     ` <1397546586-6776-1-git-send-email-zhiguohong-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2014-04-15 20:14       ` Vivek Goyal
     [not found]         ` <20140415201448.GC13033-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-04-18  2:41           ` 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=1397546303-6709-1-git-send-email-zhiguohong@tencent.com \
    --to=honkiko-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@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).