From: Vivek Goyal <vgoyal@redhat.com>
To: Justin TerAvest <teravest@google.com>
Cc: jaxboe@fusionio.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] cfq-iosched: Don't set active queue in preempt
Date: Tue, 22 Mar 2011 18:06:51 -0400 [thread overview]
Message-ID: <20110322220651.GA8080@redhat.com> (raw)
In-Reply-To: <AANLkTi=GcnW2JCrc0JE4+y5PwSgNjcaquEn-btydS4NT@mail.gmail.com>
On Tue, Mar 22, 2011 at 02:58:48PM -0700, Justin TerAvest wrote:
[..]
> >> cfqd->active_queue = cfqq;
> >> @@ -3332,7 +3338,8 @@ static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
> >> BUG_ON(!cfq_cfqq_on_rr(cfqq));
> >>
> >> cfq_service_tree_add(cfqd, cfqq, 1);
> >> - __cfq_set_active_queue(cfqd, cfqq);
> >> +
> >> + cfq_clear_queue_stats(cfqd, cfqq);
> >
> > Hi Justin,
> >
> > Why do we have to clear queue stats here for the preempting queue?
> >
> > Especially look at cfqq->dispatch_start = jiffies. We have not started
> > the dispatch yet. When this queue is selected next, then we will start
> > the dispatch.
> >
> > So this patch has introduced another bug now. Now after preemption if
> > we don't select this group, then we have a queue with wrong dispatch
> > start and that will result in huge slice_used for the queue and
> > it will not get its fair share.
>
> Hi Vivek,
>
> Ugh, you're right. Sorry, I had some bad ideas in my head for how
> preemption worked that clearly aren't true.
> I think that if the stats aren't cleared here, everything should then
> be fine because jiffies will then be picked up when the active queue
> is set. Does that sound sane to you?
>
Yes, that makes sense. Primarily you are looking for unaccounted seek time
(slice_start - dispatch_start) and dispatch_start will be set when the
preempting queue is selected for dispatch. So I don't think you have to
clear up anything in cfq_preempt_queue().
Thanks
Vivek
next prev parent reply other threads:[~2011-03-22 22:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 20:17 [PATCH 0/2] cfq: Fixes for unaccounted_time variable Justin TerAvest
2011-03-22 20:17 ` [PATCH 1/2] cfq-iosched: Don't set active queue in preempt Justin TerAvest
2011-03-22 20:59 ` Vivek Goyal
2011-03-22 21:58 ` Justin TerAvest
2011-03-22 22:06 ` Vivek Goyal [this message]
2011-03-22 20:17 ` [PATCH 2/2] blk-cgroup: Only give unaccounted_time under debug Justin TerAvest
2011-03-22 20:27 ` [PATCH 0/2] cfq: Fixes for unaccounted_time variable Jens Axboe
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=20110322220651.GA8080@redhat.com \
--to=vgoyal@redhat.com \
--cc=jaxboe@fusionio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=teravest@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.