Annotation of /trunk/kernel26-alx/patches-2.6.17-r6/0012-2.6.17-cfq-ioprio_inherit_rt_class.patch
Parent Directory | Revision Log
Revision 199 -
(hide annotations)
(download)
Fri May 18 11:04:36 2007 UTC (17 years, 4 months ago) by niro
File size: 2075 byte(s)
Fri May 18 11:04:36 2007 UTC (17 years, 4 months ago) by niro
File size: 2075 byte(s)
-import
1 | niro | 199 | If a realtime task does not explicitly set an ioprio make it inherit the |
2 | realtime class and a priority dependant on its realtime priority. | ||
3 | |||
4 | Signed-off-by: Con Kolivas <kernel@kolivas.org> | ||
5 | |||
6 | --- | ||
7 | block/cfq-iosched.c | 4 ++-- | ||
8 | include/linux/ioprio.h | 13 ++++++++++++- | ||
9 | 2 files changed, 14 insertions(+), 3 deletions(-) | ||
10 | |||
11 | Index: linux-ck-dev/block/cfq-iosched.c | ||
12 | =================================================================== | ||
13 | --- linux-ck-dev.orig/block/cfq-iosched.c 2006-06-18 15:20:13.000000000 +1000 | ||
14 | +++ linux-ck-dev/block/cfq-iosched.c 2006-06-18 15:23:53.000000000 +1000 | ||
15 | @@ -1354,10 +1354,10 @@ static void cfq_init_prio_data(struct cf | ||
16 | printk(KERN_ERR "cfq: bad prio %x\n", ioprio_class); | ||
17 | case IOPRIO_CLASS_NONE: | ||
18 | /* | ||
19 | - * no prio set, place us in the middle of the BE classes | ||
20 | + * Select class and ioprio according to policy and nice | ||
21 | */ | ||
22 | + cfqq->ioprio_class = task_policy_ioprio_class(tsk); | ||
23 | cfqq->ioprio = task_nice_ioprio(tsk); | ||
24 | - cfqq->ioprio_class = IOPRIO_CLASS_BE; | ||
25 | break; | ||
26 | case IOPRIO_CLASS_RT: | ||
27 | cfqq->ioprio = task_ioprio(tsk); | ||
28 | Index: linux-ck-dev/include/linux/ioprio.h | ||
29 | =================================================================== | ||
30 | --- linux-ck-dev.orig/include/linux/ioprio.h 2006-06-18 15:20:13.000000000 +1000 | ||
31 | +++ linux-ck-dev/include/linux/ioprio.h 2006-06-18 15:23:53.000000000 +1000 | ||
32 | @@ -22,7 +22,7 @@ | ||
33 | * class, the default for any process. IDLE is the idle scheduling class, it | ||
34 | * is only served when no one else is using the disk. | ||
35 | */ | ||
36 | -enum { | ||
37 | +enum ioprio_class { | ||
38 | IOPRIO_CLASS_NONE, | ||
39 | IOPRIO_CLASS_RT, | ||
40 | IOPRIO_CLASS_BE, | ||
41 | @@ -51,8 +51,19 @@ static inline int task_ioprio(struct tas | ||
42 | return IOPRIO_PRIO_DATA(task->ioprio); | ||
43 | } | ||
44 | |||
45 | +static inline enum ioprio_class | ||
46 | + task_policy_ioprio_class(struct task_struct *task) | ||
47 | +{ | ||
48 | + if (rt_task(task)) | ||
49 | + return IOPRIO_CLASS_RT; | ||
50 | + return IOPRIO_CLASS_BE; | ||
51 | +} | ||
52 | + | ||
53 | static inline int task_nice_ioprio(struct task_struct *task) | ||
54 | { | ||
55 | + if (rt_task(task)) | ||
56 | + return (MAX_RT_PRIO - task->rt_priority) * IOPRIO_BE_NR / | ||
57 | + MAX_RT_PRIO; | ||
58 | return (task_nice(task) + 20) / 5; | ||
59 | } | ||
60 |