linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-2.6.12-rc6-mm1] blk: cfq_find_next_crq fix
@ 2005-06-16  3:56 Tejun Heo
  2005-06-16  6:58 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2005-06-16  3:56 UTC (permalink / raw)
  To: axboe, akpm, linux-kernel

 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-2.6.12-rc6-mm1] blk: cfq_find_next_crq fix
  2005-06-16  3:56 [PATCH linux-2.6.12-rc6-mm1] blk: cfq_find_next_crq fix Tejun Heo
@ 2005-06-16  6:58 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2005-06-16  6:58 UTC (permalink / raw)
  To: Tejun Heo; +Cc: akpm, linux-kernel

On Thu, Jun 16 2005, Tejun Heo wrote:
>  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.

Good spotting, applied. I'll set up an iosched git tree as well, with a
cfq-ts branch.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-16  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-16  3:56 [PATCH linux-2.6.12-rc6-mm1] blk: cfq_find_next_crq fix Tejun Heo
2005-06-16  6:58 ` Jens Axboe

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).