Magellan Linux

Contents of /trunk/kernel26-magellan/patches-2.6.21-r1/0009-2.6.21-cfq-ioprio_inherit_rt_class.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 196 - (show annotations) (download)
Thu May 17 23:20:52 2007 UTC (16 years, 11 months ago) by niro
File size: 2105 byte(s)
-ver bump to 2.6.21-r1 using:
-linux-2.6.21.1
-2.6.21-ck2 patchset
-fbsplash-0.9.2-r5
-vesafb-tng-1.0-rc2
-squashfs-3.2-r2
-unionfs-2.0-u2
-suspend2-2.2.9.17
-linux-phc-0.2.10
-acpi-dsdt-0.8.4
-fuse-2.6.5
-reiser4-mm
-nvidia-drivers-1.0.9755
-ati-drivers-8.36.5
-ipw3945-1.2.1
- added a fix for sis900 oops on linux-2.6.21

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