From: Vivek Goyal <vgoyal@redhat.com>
To: majianpeng <majianpeng@gmail.com>
Cc: axboe <axboe@kernel.dk>,
linux-kernel <linux-kernel@vger.kernel.org>, tj <tj@kernel.org>
Subject: Re: Re: [PATCH] blkcg: Before starting a new slice, firstly count bps/iops limit in func tg_may_dispatch.
Date: Mon, 14 Jan 2013 10:22:33 -0500 [thread overview]
Message-ID: <20130114152233.GB2380@redhat.com> (raw)
In-Reply-To: <201301141015538278161@gmail.com>
On Mon, Jan 14, 2013 at 10:15:58AM +0800, majianpeng wrote:
[..]
> >Index: linux-2.6/block/blk-throttle.c
> >===================================================================
> >--- linux-2.6.orig/block/blk-throttle.c 2012-10-18 01:52:28.000000000 -0400
> >+++ linux-2.6/block/blk-throttle.c 2013-01-14 03:40:41.355731375 -0500
> >@@ -648,8 +648,14 @@ static bool tg_may_dispatch(struct throt
> > * If previous slice expired, start a new one otherwise renew/extend
> > * existing slice to make sure it is at least throtl_slice interval
> > * long since now.
> >+ *
> >+ * Start a new slice only if there is no bio queued in that direction.
> >+ * That bio is waiting to be dispatched and slice needs to be
> >+ * extended. It might happen that bio waited to be dispatched but
> >+ * workqueue execution got little late it might restart a new slice
> >+ * instead of taking all the waited time into account.
> > */
> >- if (throtl_slice_used(td, tg, rw))
> >+ if (throtl_slice_used(td, tg, rw) && !tg->nr_queued[rw])
> > throtl_start_new_slice(td, tg, rw);
> > else {
> > if (time_before(tg->slice_end[rw], jiffies + throtl_slice))
> Hi vivek,
> Your patch is ok.But i had a question:
> What's condition tg->nr_queued[rw] = 0, but bio is not null?
When a new bio is about to be queued in an empty group (look at
blk_throtl_bio). At that time, tg->nr_queued[rw] might be 0 if no other
bio is already queued.
Thanks
Vivek
next prev parent reply other threads:[~2013-01-14 15:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 9:11 [PATCH] blkcg: Before starting a new slice, firstly count bps/iops limit in func tg_may_dispatch majianpeng
2013-01-11 14:26 ` Jens Axboe
2013-01-11 19:17 ` Vivek Goyal
2013-01-14 2:15 ` majianpeng
2013-01-14 15:22 ` Vivek Goyal [this message]
2013-01-15 0:30 ` majianpeng
2013-01-14 2:21 ` majianpeng
2013-01-14 2:25 ` majianpeng
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=20130114152233.GB2380@redhat.com \
--to=vgoyal@redhat.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=majianpeng@gmail.com \
--cc=tj@kernel.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).