Skip to contentSkip to conversation

cfq: fix IOPRIO_CLASS_IDLE accounting

PATCH In review Oleg Nesterov 2 participants 2 messages Nov 4, 2007 – Nov 5, 2007 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfq: fix IOPRIO_CLASS_IDLE accounting

(untested, needs an ack from maintainer)

Spotted by Nick <[email protected]>, 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.

block/cfq-iosched.c renamed from block/cfq-iosched.c~ +3 -2
@@ -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)
#1 lore raw
Quoted 7 lines · Oleg Nesterov

(untested, needs an ack from maintainer)

Spotted by Nick <[email protected]>, 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.

That's obviously buggy, thanks Oleg! Fix is indeed correct. I'll add it.

Signature · 1 line
Jens Axboe