From 244d30476a6fa49d67c13ecf3751d2fa33785b4a Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Sat, 8 Jun 2013 23:06:20 +0200 Subject: P-FP: fix admission of suspended task This commit fixes admission of suspended tasks under the P-FP plugin analogously to commit 78ae3306ff8b63a4592044aa28c2f2cbc1d36b20. --- litmus/sched_pfp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c index aade09044917..6113ae376bec 100644 --- a/litmus/sched_pfp.c +++ b/litmus/sched_pfp.c @@ -296,7 +296,7 @@ static void pfp_finish_switch(struct task_struct *prev) /* Prepare a task for running in RT mode */ -static void pfp_task_new(struct task_struct * t, int on_rq, int running) +static void pfp_task_new(struct task_struct * t, int on_rq, int is_scheduled) { pfp_domain_t* pfp = task_pfp(t); unsigned long flags; @@ -307,15 +307,12 @@ static void pfp_task_new(struct task_struct * t, int on_rq, int running) /* setup job parameters */ release_at(t, litmus_clock()); - /* The task should be running in the queue, otherwise signal - * code will try to wake it up with fatal consequences. - */ raw_spin_lock_irqsave(&pfp->slock, flags); - if (running) { + if (is_scheduled) { /* there shouldn't be anything else running at the time */ BUG_ON(pfp->scheduled); pfp->scheduled = t; - } else { + } else if (is_running(t)) { requeue(t, pfp); /* maybe we have to reschedule */ pfp_preempt_check(pfp); -- cgit v1.2.2