[PATCH] cfq: fix IOPRIO_CLASS_IDLE accounting

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>, Jens Axboe <axboe@...>
Cc: Nick <gentuu@...>, Randy Dunlap <randy.dunlap@...>, <linux-kernel@...>
Date: Sunday, November 4, 2007 - 3:32 pm

(untested, needs an ack from maintainer)

Spotted by Nick <gentuu@gmail.com>, hopefully can explain the second trace in
http://bugzilla.kernel.org/show_bug.cgi?id=9180.

If ->async_idle_cfqq != NULL cfq_put_async_queues() puts it IOPRIO_BE_NR times
in a loop. Fix this.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- cfq/block/cfq-iosched.c~	2007-08-09 19:59:26.000000000 +0400
+++ cfq/block/cfq-iosched.c	2007-11-04 22:23:42.000000000 +0300
@@ -2065,9 +2065,10 @@ static void cfq_put_async_queues(struct 
 			cfq_put_queue(cfqd->async_cfqq[0][i]);
 		if (cfqd->async_cfqq[1][i])
 			cfq_put_queue(cfqd->async_cfqq[1][i]);
-		if (cfqd->async_idle_cfqq)
-			cfq_put_queue(cfqd->async_idle_cfqq);
 	}
+
+	if (cfqd->async_idle_cfqq)
+		cfq_put_queue(cfqd->async_idle_cfqq);
 }
 
 static void cfq_exit_queue(elevator_t *e)

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] cfq: fix IOPRIO_CLASS_IDLE accounting, Oleg Nesterov, (Sun Nov 4, 3:32 pm)
Re: [PATCH] cfq: fix IOPRIO_CLASS_IDLE accounting, Jens Axboe, (Mon Nov 5, 3:57 am)