From: Jens Axboe Date: Wed, 14 Jun 2006 07:10:45 +0000 (+0200) Subject: [PATCH] cfq-iosched: correctly set ioprio on both targets X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=35e6077cb16f93517ba5a51ba849b186d2474d60;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [PATCH] cfq-iosched: correctly set ioprio on both targets Patch originally from Vasily Tarasov 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. Signed-off-by: Jens Axboe --- diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 4c4e9cc3ae2..84b75f88c27 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -1388,10 +1388,9 @@ static inline void changed_ioprio(struct cfq_io_context *cic) } } 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); } }