diff options
-rw-r--r-- | kernel/sched.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index c6827f94e156..e1f57bd5aaa6 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3508,25 +3508,24 @@ void set_user_nice(task_t *p, long nice) | |||
3508 | * not SCHED_NORMAL: | 3508 | * not SCHED_NORMAL: |
3509 | */ | 3509 | */ |
3510 | if (rt_task(p)) { | 3510 | if (rt_task(p)) { |
3511 | dec_prio_bias(rq, p->static_prio); | ||
3512 | p->static_prio = NICE_TO_PRIO(nice); | 3511 | p->static_prio = NICE_TO_PRIO(nice); |
3513 | inc_prio_bias(rq, p->static_prio); | ||
3514 | goto out_unlock; | 3512 | goto out_unlock; |
3515 | } | 3513 | } |
3516 | array = p->array; | 3514 | array = p->array; |
3517 | if (array) | 3515 | if (array) { |
3518 | dequeue_task(p, array); | 3516 | dequeue_task(p, array); |
3517 | dec_prio_bias(rq, p->static_prio); | ||
3518 | } | ||
3519 | 3519 | ||
3520 | old_prio = p->prio; | 3520 | old_prio = p->prio; |
3521 | new_prio = NICE_TO_PRIO(nice); | 3521 | new_prio = NICE_TO_PRIO(nice); |
3522 | delta = new_prio - old_prio; | 3522 | delta = new_prio - old_prio; |
3523 | dec_prio_bias(rq, p->static_prio); | ||
3524 | p->static_prio = NICE_TO_PRIO(nice); | 3523 | p->static_prio = NICE_TO_PRIO(nice); |
3525 | inc_prio_bias(rq, p->static_prio); | ||
3526 | p->prio += delta; | 3524 | p->prio += delta; |
3527 | 3525 | ||
3528 | if (array) { | 3526 | if (array) { |
3529 | enqueue_task(p, array); | 3527 | enqueue_task(p, array); |
3528 | inc_prio_bias(rq, p->static_prio); | ||
3530 | /* | 3529 | /* |
3531 | * If the task increased its priority or is running and | 3530 | * If the task increased its priority or is running and |
3532 | * lowered its priority, then reschedule its CPU: | 3531 | * lowered its priority, then reschedule its CPU: |