Magellan Linux

Contents of /trunk/kernel26-magellan/patches-2.6.20-r1/0004-2.6.20-sched-range.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 106 - (show annotations) (download)
Sun Mar 11 16:18:20 2007 UTC (17 years, 2 months ago) by niro
File size: 1724 byte(s)
ver bump to 2.6.20-r1;
- using linux-2.6.20.2
- 2.6.20-ck1 patch set
- 8.34.8 ati-drivers
- 1.0-9755 nvidia-drivers
- 1.2.0 ipw-drivers
- squashfs-3.0 support
- vesafb-tng 1.0-rc2
- fbsplash-0.9.2-r5 for linux-2.6.20-rc6
- removed zd1211 drivers (now in upstream tree)

1 Add SCHED_RANGE and SCHED_RT wrappers for easy policy management.
2
3 Signed-off-by: Con Kolivas <kernel@kolivas.org>
4
5 include/linux/sched.h | 6 +++++-
6 kernel/sched.c | 3 +--
7 2 files changed, 6 insertions(+), 3 deletions(-)
8
9 Index: linux-2.6.20-ck1/include/linux/sched.h
10 ===================================================================
11 --- linux-2.6.20-ck1.orig/include/linux/sched.h 2007-02-16 19:01:30.000000000 +1100
12 +++ linux-2.6.20-ck1/include/linux/sched.h 2007-02-16 19:01:30.000000000 +1100
13 @@ -37,6 +37,9 @@
14
15 #ifdef __KERNEL__
16
17 +#define SCHED_MAX SCHED_BATCH
18 +#define SCHED_RANGE(policy) ((policy) <= SCHED_MAX)
19 +
20 struct sched_param {
21 int sched_priority;
22 };
23 @@ -530,7 +533,8 @@ struct signal_struct {
24 #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO)
25 #define rt_task(p) rt_prio((p)->prio)
26 #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
27 -#define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH)
28 +#define is_rt_policy(policy) ((policy) == SCHED_FIFO || \
29 + (policy) == SCHED_RR)
30 #define has_rt_policy(p) unlikely(is_rt_policy((p)->policy))
31
32 /*
33 Index: linux-2.6.20-ck1/kernel/sched.c
34 ===================================================================
35 --- linux-2.6.20-ck1.orig/kernel/sched.c 2007-02-16 19:01:30.000000000 +1100
36 +++ linux-2.6.20-ck1/kernel/sched.c 2007-02-16 19:01:30.000000000 +1100
37 @@ -3981,8 +3981,7 @@ recheck:
38 /* double check policy once rq lock held */
39 if (policy < 0)
40 policy = oldpolicy = p->policy;
41 - else if (policy != SCHED_FIFO && policy != SCHED_RR &&
42 - policy != SCHED_NORMAL && policy != SCHED_BATCH)
43 + else if (!SCHED_RANGE(policy))
44 return -EINVAL;
45 /*
46 * Valid priorities for SCHED_FIFO and SCHED_RR are