From: Vivek Goyal <vgoyal@redhat.com>
To: Corrado Zoccolo <czoccolo@gmail.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
Jens Axboe <jens.axboe@oracle.com>,
Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH 2/4] cfq-iosched: fix no-idle preemption logic
Date: Tue, 24 Nov 2009 09:37:05 -0500 [thread overview]
Message-ID: <20091124143705.GB9595@redhat.com> (raw)
In-Reply-To: <200911241449.02473.czoccolo@gmail.com>
On Tue, Nov 24, 2009 at 02:49:02PM +0100, Corrado Zoccolo wrote:
> An incoming no-idle queue should preempt the active no-idle queue
> only if the active queue is idling due to service tree empty.
> Previous code was buggy in two ways:
> * it relied on service_tree field to be set on the active queue, while
> it is not set when the code is idling for a new request
> * it didn't check for the service tree empty condition, so could lead to
> LIFO behaviour if multiple queues with depth > 1 were preempting each
> other on an non-NCQ device.
>
> Reported-by: Vivek Goyal <vgoyal@redhat.com>
> Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
> ---
> block/cfq-iosched.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index 6925ab9..2a304f4 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -2401,8 +2401,9 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
> if (cfq_class_idle(cfqq))
> return true;
>
> - if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD
> - && new_cfqq->service_tree == cfqq->service_tree)
> + if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD &&
> + cfqq_type(new_cfqq) == SYNC_NOIDLE_WORKLOAD &&
> + new_cfqq->service_tree->count == 1)
> return true;
>
Looks good to me.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Thanks
Vivek
prev parent reply other threads:[~2009-11-24 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-24 13:49 [PATCH 2/4] cfq-iosched: fix no-idle preemption logic Corrado Zoccolo
2009-11-24 14:37 ` Vivek Goyal [this message]
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=20091124143705.GB9595@redhat.com \
--to=vgoyal@redhat.com \
--cc=czoccolo@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=jmoyer@redhat.com \
--cc=linux-kernel@vger.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 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.