Skip to content

Commit

Permalink
[PATCH] cfq-iosched: correctly set ioprio on both targets
Browse files Browse the repository at this point in the history
Patch originally from Vasily Tarasov <vtaras@sw.ru>

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 <axboe@suse.de>
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Jun 23, 2006
1 parent b17fd9b commit 35e6077
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 35e6077

Please sign in to comment.