lkml.org 
[lkml]   [2005]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] SCHED: change_prio_bias_only_if_queued
Date
On Sat, 21 May 2005 15:00, Con Kolivas wrote:
> Ok I've respun the smp nice support for the cpu scheduler modifications
> that are in current -mm. Tested on 2.6.12-rc4-mm2 on 4x and seems to work
> fine.

Thanks to Peter Williams for noting I should only change the prio_bias if the
task is queued in set_user_nice.

Con
---

prio_bias should only be adjusted in set_user_nice if p is actually currently
queued.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

Index: linux-2.6.12-rc4-mm2/kernel/sched.c
===================================================================
--- linux-2.6.12-rc4-mm2.orig/kernel/sched.c 2005-05-21 14:25:07.000000000 +1000
+++ linux-2.6.12-rc4-mm2/kernel/sched.c 2005-05-23 19:23:10.000000000 +1000
@@ -3399,25 +3399,24 @@ void set_user_nice(task_t *p, long nice)
* not SCHED_NORMAL:
*/
if (rt_task(p)) {
- dec_prio_bias(rq, p->static_prio);
p->static_prio = NICE_TO_PRIO(nice);
- inc_prio_bias(rq, p->static_prio);
goto out_unlock;
}
array = p->array;
- if (array)
+ if (array) {
dequeue_task(p, array);
+ dec_prio_bias(rq, p->static_prio);
+ }

old_prio = p->prio;
new_prio = NICE_TO_PRIO(nice);
delta = new_prio - old_prio;
- dec_prio_bias(rq, p->static_prio);
p->static_prio = NICE_TO_PRIO(nice);
- inc_prio_bias(rq, p->static_prio);
p->prio += delta;

if (array) {
enqueue_task(p, array);
+ inc_prio_bias(rq, p->static_prio);
/*
* If the task increased its priority or is running and
* lowered its priority, then reschedule its CPU:[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-05-23 11:32    [W:0.209 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site