* [PATCH] RT: Fix a bug for properly setting the priority on rt-dequeue
@ 2007-11-14 21:31 Gregory Haskins
0 siblings, 0 replies; only message in thread
From: Gregory Haskins @ 2007-11-14 21:31 UTC (permalink / raw)
To: rostedt; +Cc: ghaskins, linux-rt-users, mingo
Hi Steven,
This patch applies to 23-rt11 to fix that bug you found in the git-HEAD
merge. I will fold this patch into my 24 series so it is fixed there. Feel
free to fold this into patch "#8" instead of maintaining it seperately, if
you prefer.
--------------------------
RT: Fix a bug for properly setting the priority on rt-dequeue
We need to update the priority on task-dequeue whenever it changes, not just
if more RT tasks are pending.
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
---
kernel/sched_rt.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index f05912a..864d18a 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -85,6 +85,8 @@ static inline void inc_rt_tasks(struct task_struct *p, struct rq *rq)
static inline void dec_rt_tasks(struct task_struct *p, struct rq *rq)
{
+ int highest_prio = rq->rt.highest_prio;
+
WARN_ON(!rt_task(p));
WARN_ON(!rq->rt.rt_nr_running);
rq->rt.rt_nr_running--;
@@ -98,13 +100,15 @@ static inline void dec_rt_tasks(struct task_struct *p, struct rq *rq)
array = &rq->rt.active;
rq->rt.highest_prio =
sched_find_first_bit(array->bitmap);
- cpupri_set(rq->cpu, rq->rt.highest_prio);
} /* otherwise leave rq->highest prio alone */
} else
rq->rt.highest_prio = MAX_RT_PRIO;
if (p->nr_cpus_allowed > 1)
rq->rt.rt_nr_migratory--;
+ if (rq->rt.highest_prio != highest_prio)
+ cpupri_set(rq->cpu, rq->rt.highest_prio);
+
update_rt_migration(p, rq);
#endif /* CONFIG_SMP */
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-14 21:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-14 21:31 [PATCH] RT: Fix a bug for properly setting the priority on rt-dequeue Gregory Haskins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).