Re: CFQ ioprio setting patch

From: Jens Axboe
Date: Wed Jun 14 2006 - 01:23:14 EST


On Wed, May 24 2006, Vasily Tarasov wrote:
> If you set io-priority of process 1 using sys_ioprio_set system call by
> another process 2 (like ionice do),
> then cfq_init_prio_data() function sets priority of process 2 (current)
> on queue of process 1 and clears the flag, that designates change of ioprio.
> So the process 1 will work like with priority of process 2.
>
> I propose not to call cfq_init_prio_data() on io-priority change, but
> only mark queue as queue with changed prority.
> Every time when new request comes cfq-scheduler checks for this flag and
> atomaticaly changes priority of queue to new value.

Your analysis looks correct. However the patch is not -stable material,
I've queued it for inclusion post 2.6.17, thanks. Newer version below
for 2.6.17-rc6. If you have the time, please test that 2.6.17-rc6 has
the same bug and that this patch (which is just a port of yours) does
fix it.

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 56bec4e..e636b0f 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1400,10 +1400,9 @@ static inline void changed_ioprio(struct
}
}
cfqq = cic->cfqq[SYNC];
- if (cfqq) {
+ if (cfqq)
cfq_mark_cfqq_prio_changed(cfqq);
- cfq_init_prio_data(cfqq);
- }
+
spin_unlock(cfqd->queue->queue_lock);
}
}

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/