Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 275

kernel-2.6.18-194.11.1.el5.src.rpm

From: Jeff Moyer <jmoyer@redhat.com>
Date: Thu, 25 Mar 2010 16:53:15 -0400
Subject: [block] cfq-iosched: fix IOPRIO_CLASS_IDLE accounting
Message-id: <1269535995-21213-6-git-send-email-jmoyer@redhat.com>
Patchwork-id: 23753
O-Subject: [RHEL5 PATCH 5/5] cfq: fix IOPRIO_CLASS_IDLE accounting
Bugzilla: 574285
RH-Acked-by: Vivek Goyal <vgoyal@redhat.com>
RH-Acked-by: Jerome Marchand <jmarchan@redhat.com>

This backport fixes a bug introduced by the patch to add back in the
per-ioprio cfq queue.  This is related to bug 574285.

commit 2389d1ef172fc9df01f58265a436919d233fbc27
Author: Oleg Nesterov <oleg@tv-sign.ru>
Date:   Mon Nov 5 08:58:05 2007 +0100

    cfq: fix IOPRIO_CLASS_IDLE accounting

    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>
    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 8843b06..c747c73 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2600,9 +2600,10 @@ static void cfq_put_async_queues(struct cfq_data *cfqd)
 			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)