diff options
author | Vasily Tarasov <vtaras@openvz.org> | 2007-07-20 04:06:38 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-20 04:06:38 -0400 |
commit | c2dea2d1fdbce86942dba0a968c523d8b7858bb5 (patch) | |
tree | c876b93785ee3b25c341be0dd5080a5176f27736 /include | |
parent | 9a79b2274186fade17134929d4f85b70d59a3840 (diff) |
cfq: async queue allocation per priority
If we have two processes with different ioprio_class, but the same
ioprio_data, their async requests will fall into the same queue. I guess
such behavior is not expected, because it's not right to put real-time
requests and best-effort requests in the same queue.
The attached patch fixes the problem by introducing additional *cfqq
fields on cfqd, pointing to per-(class,priority) async queues.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ioprio.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index 2eaa142cd061..baf29387cab4 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h | |||
@@ -53,6 +53,14 @@ static inline int task_ioprio(struct task_struct *task) | |||
53 | return IOPRIO_NORM; | 53 | return IOPRIO_NORM; |
54 | } | 54 | } |
55 | 55 | ||
56 | static inline int task_ioprio_class(struct task_struct *task) | ||
57 | { | ||
58 | if (ioprio_valid(task->ioprio)) | ||
59 | return IOPRIO_PRIO_CLASS(task->ioprio); | ||
60 | |||
61 | return IOPRIO_CLASS_BE; | ||
62 | } | ||
63 | |||
56 | static inline int task_nice_ioprio(struct task_struct *task) | 64 | static inline int task_nice_ioprio(struct task_struct *task) |
57 | { | 65 | { |
58 | return (task_nice(task) + 20) / 5; | 66 | return (task_nice(task) + 20) / 5; |