Contents of /trunk/kernel26-alx/patches-2.6.21-r13/0009-2.6.21-cfq-ioprio_inherit_rt_class.patch
Parent Directory | Revision Log
Revision 445 -
(show annotations)
(download)
Tue Jan 15 00:44:37 2008 UTC (16 years, 8 months ago) by niro
File size: 2105 byte(s)
Tue Jan 15 00:44:37 2008 UTC (16 years, 8 months ago) by niro
File size: 2105 byte(s)
-added patches for 2.6.21-alx-r13
1 | 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-2.6.21-ck2/block/cfq-iosched.c |
12 | =================================================================== |
13 | --- linux-2.6.21-ck2.orig/block/cfq-iosched.c 2007-05-14 19:49:19.000000000 +1000 |
14 | +++ linux-2.6.21-ck2/block/cfq-iosched.c 2007-05-14 19:49:54.000000000 +1000 |
15 | @@ -1258,10 +1258,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-2.6.21-ck2/include/linux/ioprio.h |
29 | =================================================================== |
30 | --- linux-2.6.21-ck2.orig/include/linux/ioprio.h 2007-05-14 19:49:19.000000000 +1000 |
31 | +++ linux-2.6.21-ck2/include/linux/ioprio.h 2007-05-14 19:49:54.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 + 1); |
58 | return (task_nice(task) + 20) / 5; |
59 | } |
60 |