diff -urN linux-2.4.19-pre7-ac2-rml/kernel/sched.c linux/kernel/sched.c --- linux-2.4.19-pre7-ac2-rml/kernel/sched.c Sat Apr 20 18:24:21 2002 +++ linux/kernel/sched.c Sat Apr 20 18:25:40 2002 @@ -22,17 +22,18 @@ #include /* - * Priority of a process goes from 0 to 139. The 0-99 - * priority range is allocated to RT tasks, the 100-139 - * range is for SCHED_OTHER tasks. Priority values are - * inverted: lower p->prio value means higher priority. + * Priority of a process goes from 0 to MAX_PRIO-1. The + * 0 to MAX_RT_PRIO-1 priority range is allocated to RT tasks, + * the MAX_RT_PRIO to MAX_PRIO range is for SCHED_OTHER tasks. + * Priority values are inverted: lower p->prio value means higher + * priority. */ #define MAX_RT_PRIO 100 #define MAX_PRIO (MAX_RT_PRIO + 40) /* * Convert user-nice values [ -20 ... 0 ... 19 ] - * to static priority [ 100 ... 139 (MAX_PRIO-1) ], + * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], * and back. */ #define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20) @@ -1071,7 +1072,7 @@ */ int task_prio(task_t *p) { - return p->prio - 100; + return p->prio - MAX_RT_PRIO; } int task_nice(task_t *p) @@ -1126,13 +1127,13 @@ policy != SCHED_OTHER) goto out_unlock; } - + /* - * Valid priorities for SCHED_FIFO and SCHED_RR are 1..99, valid - * priority for SCHED_OTHER is 0. + * Valid priorities for SCHED_FIFO and SCHED_RR are 1..MAX_RT_PRIO-1, + * valid priority for SCHED_OTHER is 0. */ retval = -EINVAL; - if (lp.sched_priority < 0 || lp.sched_priority > 99) + if (lp.sched_priority < 0 || lp.sched_priority > MAX_RT_PRIO - 1) goto out_unlock; if ((policy == SCHED_OTHER) != (lp.sched_priority == 0)) goto out_unlock; @@ -1152,7 +1153,7 @@ p->policy = policy; p->rt_priority = lp.sched_priority; if (rt_task(p)) - p->prio = 99 - p->rt_priority; + p->prio = (MAX_RT_PRIO - 1) - p->rt_priority; else p->prio = p->static_prio; if (array) @@ -1275,7 +1276,7 @@ switch (policy) { case SCHED_FIFO: case SCHED_RR: - ret = 99; + ret = MAX_RT_PRIO - 1; break; case SCHED_OTHER: ret = 0;