* CFQ ioprio setting patch
@ 2006-05-24 12:00 Vasily Tarasov
2006-06-14 5:24 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Vasily Tarasov @ 2006-05-24 12:00 UTC (permalink / raw)
To: axboe; +Cc: linux-kernel, Kirill Korotaev
[-- Attachment #1: Type: text/plain, Size: 588 bytes --]
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.
Small patch is below.
[-- Attachment #2: diff-cfq-ioprio-set-20060529 --]
[-- Type: text/plain, Size: 405 bytes --]
--- linux-2.6.16-026stab012-ioprio/block/cfq-iosched.c.orig 2006-05-29 13:46:20.000000000 +0400
+++ linux-2.6.16-026stab012-ioprio/block/cfq-iosched.c 2006-05-24 15:31:24.000000000 +0400
@@ -1325,7 +1325,6 @@ static inline void changed_ioprio(struct
spin_lock(cfqd->queue->queue_lock);
cfq_mark_cfqq_prio_changed(cfqq);
- cfq_init_prio_data(cfqq);
spin_unlock(cfqd->queue->queue_lock);
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: CFQ ioprio setting patch
2006-05-24 12:00 CFQ ioprio setting patch Vasily Tarasov
@ 2006-06-14 5:24 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2006-06-14 5:24 UTC (permalink / raw)
To: Vasily Tarasov; +Cc: linux-kernel, Kirill Korotaev
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-14 5:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-24 12:00 CFQ ioprio setting patch Vasily Tarasov
2006-06-14 5:24 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.