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 <[email protected]> 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:
Attachment:
pgprwhGv96IFs.pgp
Description: PGP signature
- Follow-Ups:
- [PATCH] SCHED: account_rt_tasks_in_prio_bias
- From: Con Kolivas <[email protected]>
- [PATCH] SCHED: account_rt_tasks_in_prio_bias
- References:
- Re: [PATCH] implement nice support across physical cpus on SMP
- From: [email protected] (Markus Törnqvist)
- Re: [SMP NICE] [PATCH] SCHED: Implement nice support across physical cpus on SMP
- From: Con Kolivas <[email protected]>
- [PATCH] SCHED: Implement nice support across physical cpus on SMP
- From: Con Kolivas <[email protected]>
- Re: [PATCH] implement nice support across physical cpus on SMP
- Prev by Date: Re: snd-intel8x0 buggy on Nvidia CK804, TYAN, AMD Opteron board?
- Next by Date: Re: [2.6 patch] sound/isa/: cleanups
- Previous by thread: [PATCH] SCHED: Implement nice support across physical cpus on SMP
- Next by thread: [PATCH] SCHED: account_rt_tasks_in_prio_bias
- Index(es):