Magellan Linux

Contents of /trunk/kernel26-alx/patches-2.6.20-r6/0010-2.6.20-cfq-ioprio_inherit_rt_class.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1175 - (show annotations) (download)
Thu Oct 14 12:15:46 2010 UTC (13 years, 6 months ago) by niro
File size: 2105 byte(s)
-2.6.20-alx-r6 new magellan 0.5.2 kernel
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.20-ck1/block/cfq-iosched.c
12 ===================================================================
13 --- linux-2.6.20-ck1.orig/block/cfq-iosched.c 2007-02-05 22:52:00.000000000 +1100
14 +++ linux-2.6.20-ck1/block/cfq-iosched.c 2007-02-16 19:01:32.000000000 +1100
15 @@ -1211,10 +1211,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.20-ck1/include/linux/ioprio.h
29 ===================================================================
30 --- linux-2.6.20-ck1.orig/include/linux/ioprio.h 2006-09-21 19:54:58.000000000 +1000
31 +++ linux-2.6.20-ck1/include/linux/ioprio.h 2007-02-16 19:01:32.000000000 +1100
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