linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: axboe@suse.de, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH linux-2.6.12-rc6-mm1] blk: cfq_find_next_crq fix
Date: Thu, 16 Jun 2005 12:56:22 +0900	[thread overview]
Message-ID: <20050616035622.GA29153@htj.dyndns.org> (raw)

 Hello, Jens.
 Hello, Andrew.

 In cfq_find_next_crq(), cfq tries to find the next request by
choosing one of two requests before and after the current one.
Currently, when choosing the next request, if there's no next request,
the next candidate is NULL, resulting in selection of the previous
request.  This results in weird scheduling.  Once we reach the end, we
always seek backward.

 The correct behavior is using the first request as the next
candidate.  cfq_choose_req() already has logics for handling wrapped
requests.

 Signed-off-by: Tejun Heo <htejun@gmail.com>

Index: blk-fixes/drivers/block/cfq-iosched.c
===================================================================
--- blk-fixes.orig/drivers/block/cfq-iosched.c	2005-06-15 22:44:55.000000000 +0900
+++ blk-fixes/drivers/block/cfq-iosched.c	2005-06-15 22:45:21.000000000 +0900
@@ -375,9 +375,10 @@ cfq_find_next_crq(struct cfq_data *cfqd,
 	struct cfq_rq *crq_next = NULL, *crq_prev = NULL;
 	struct rb_node *rbnext, *rbprev;
 
+	rbnext = NULL;
 	if (ON_RB(&last->rb_node))
 		rbnext = rb_next(&last->rb_node);
-	else {
+	if (!rbnext) {
 		rbnext = rb_first(&cfqq->sort_list);
 		if (rbnext == &last->rb_node)
 			rbnext = NULL;

             reply	other threads:[~2005-06-16  3:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-16  3:56 Tejun Heo [this message]
2005-06-16  6:58 ` [PATCH linux-2.6.12-rc6-mm1] blk: cfq_find_next_crq fix 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=20050616035622.GA29153@htj.dyndns.org \
    --to=htejun@gmail.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --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 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).