On Mon, 23 May 2005 19:28, Con Kolivas wrote: > 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. And for completeness the effect of real time tasks' real time priority level should be considered in prio_bias instead of their nice level. Con ---
Real time tasks' effect on prio_bias should be based on their real time priority level instead of their static_prio which is based on nice. 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-23 19:23:10.000000000 +1000 +++ linux-2.6.12-rc4-mm2/kernel/sched.c 2005-05-23 19:59:45.000000000 +1000 @@ -659,21 +659,21 @@ static int effective_prio(task_t *p) } #ifdef CONFIG_SMP -static inline void inc_prio_bias(runqueue_t *rq, int static_prio) +static inline void inc_prio_bias(runqueue_t *rq, int prio) { - rq->prio_bias += MAX_PRIO - static_prio; + rq->prio_bias += MAX_PRIO - prio; } -static inline void dec_prio_bias(runqueue_t *rq, int static_prio) +static inline void dec_prio_bias(runqueue_t *rq, int prio) { - rq->prio_bias -= MAX_PRIO - static_prio; + rq->prio_bias -= MAX_PRIO - prio; } #else -static inline void inc_prio_bias(runqueue_t *rq, int static_prio) +static inline void inc_prio_bias(runqueue_t *rq, int prio) { } -static inline void dec_prio_bias(runqueue_t *rq, int static_prio) +static inline void dec_prio_bias(runqueue_t *rq, int prio) { } #endif @@ -681,13 +681,19 @@ static inline void dec_prio_bias(runqueu static inline void inc_nr_running(task_t *p, runqueue_t *rq) { rq->nr_running++; - inc_prio_bias(rq, p->static_prio); + if (rt_task(p)) + inc_prio_bias(rq, p->prio); + else + inc_prio_bias(rq, p->static_prio); } static inline void dec_nr_running(task_t *p, runqueue_t *rq) { rq->nr_running--; - dec_prio_bias(rq, p->static_prio); + if (rt_task(p)) + dec_prio_bias(rq, p->prio); + else + dec_prio_bias(rq, p->static_prio); } /*
Attachment:
pgpwIS8zFFMkk.pgp
Description: PGP signature
- References:
- Re: [PATCH] implement nice support across physical cpus on SMP
- From: [email protected] (Markus Törnqvist)
- [PATCH] SCHED: Implement nice support across physical cpus on SMP
- From: Con Kolivas <[email protected]>
- [PATCH] SCHED: change_prio_bias_only_if_queued
- From: Con Kolivas <[email protected]>
- Re: [PATCH] implement nice support across physical cpus on SMP
- Prev by Date: Re: [patch] Real-Time Preemption, -RT-2.6.12-rc4-V0.7.47-06
- Next by Date: DMA not works in Linux 2.6.12, but in Windows works fine.
- Previous by thread: [PATCH] SCHED: change_prio_bias_only_if_queued
- Next by thread: powernow-k8 in 2.6.8 - 2.6.11.8 causes system hang
- Index(es):