aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-06-08 17:25:12 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-06-08 17:25:12 -0400
commita2b73241b75f594401b64317801bfca0515f47eb (patch)
treee33a06190112da3441d92d2f831e86378ca062a2
parent3088111567f334cccff1123f9bd97f2ba52af944 (diff)
C-EDF: fix admission of suspended tasks
This patch fixes admission of suspended tasks under the P-FP plugin analogously to commit 3088111567f334cccff1123f9bd97f2ba52af944.
-rw-r--r--litmus/sched_cedf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c
index 91f7c6f91dc4..c55743f3970d 100644
--- a/litmus/sched_cedf.c
+++ b/litmus/sched_cedf.c
@@ -542,7 +542,7 @@ static void cedf_finish_switch(struct task_struct *prev)
542 542
543/* Prepare a task for running in RT mode 543/* Prepare a task for running in RT mode
544 */ 544 */
545static void cedf_task_new(struct task_struct * t, int on_rq, int running) 545static void cedf_task_new(struct task_struct * t, int on_rq, int is_scheduled)
546{ 546{
547 unsigned long flags; 547 unsigned long flags;
548 cpu_entry_t* entry; 548 cpu_entry_t* entry;
@@ -550,7 +550,7 @@ static void cedf_task_new(struct task_struct * t, int on_rq, int running)
550 550
551 TRACE("gsn edf: task new %d\n", t->pid); 551 TRACE("gsn edf: task new %d\n", t->pid);
552 552
553 /* the cluster doesn't change even if t is running */ 553 /* the cluster doesn't change even if t is scheduled */
554 cluster = task_cpu_cluster(t); 554 cluster = task_cpu_cluster(t);
555 555
556 raw_spin_lock_irqsave(&cluster->cluster_lock, flags); 556 raw_spin_lock_irqsave(&cluster->cluster_lock, flags);
@@ -558,7 +558,7 @@ static void cedf_task_new(struct task_struct * t, int on_rq, int running)
558 /* setup job params */ 558 /* setup job params */
559 release_at(t, litmus_clock()); 559 release_at(t, litmus_clock());
560 560
561 if (running) { 561 if (is_scheduled) {
562 entry = &per_cpu(cedf_cpu_entries, task_cpu(t)); 562 entry = &per_cpu(cedf_cpu_entries, task_cpu(t));
563 BUG_ON(entry->scheduled); 563 BUG_ON(entry->scheduled);
564 564
@@ -579,7 +579,8 @@ static void cedf_task_new(struct task_struct * t, int on_rq, int running)
579 } 579 }
580 t->rt_param.linked_on = NO_CPU; 580 t->rt_param.linked_on = NO_CPU;
581 581
582 cedf_job_arrival(t); 582 if (is_running(t))
583 cedf_job_arrival(t);
583 raw_spin_unlock_irqrestore(&(cluster->cluster_lock), flags); 584 raw_spin_unlock_irqrestore(&(cluster->cluster_lock), flags);
584} 585}
585 586