--- kernel/sched.c.orig 2007-02-26 11:46:46.849841000 +0100 +++ kernel/sched.c 2007-02-26 12:04:09.283056000 +0100 @@ -4227,8 +4227,6 @@ recheck: (p->mm && param->sched_priority > MAX_USER_RT_PRIO-1) || (!p->mm && param->sched_priority > MAX_RT_PRIO-1)) return -EINVAL; - if (is_rt_policy(policy) != (param->sched_priority != 0)) - return -EINVAL; /* * Allow unprivileged RT tasks to decrease priority: @@ -4302,6 +4300,13 @@ recheck: rt_mutex_adjust_pi(p); + if (!is_rt_policy(policy)) { + if (param->sched_priority == 8) + set_user_nice(p, -20); + else + set_user_nice(p, param->sched_priority-6); + } + return 0; } EXPORT_SYMBOL_GPL(sched_setscheduler);