From 944f051fda9551483399bed556870b0895df1efa Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Fri, 28 May 2010 10:39:56 -0400 Subject: Bugfix: 1) incorrect FMLP high prio task tracking and 2) race in print statement 1) High priority task tied to FMLP semaphore in P-EDF scheduling is incorrectly tracked for tasks acquiring the lock without contention. (HP is always set to CPU 0 instead of proper CPU.) 2) Race in a print statement from P-EDF's pi_block() causes NULL pointer dereference. --- include/litmus/sched_plugin.h | 2 +- litmus/fmlp.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index 94952f6ccbfa..2d856d587041 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h @@ -12,7 +12,7 @@ struct pi_semaphore { atomic_t count; int sleepers; wait_queue_head_t wait; - union { + struct { /* highest-prio holder/waiter */ struct task_struct *task; struct task_struct* cpu_task[NR_CPUS]; diff --git a/litmus/fmlp.c b/litmus/fmlp.c index d27698a1cb39..03fa7358d5eb 100644 --- a/litmus/fmlp.c +++ b/litmus/fmlp.c @@ -180,7 +180,11 @@ static int do_fmlp_down(struct pi_semaphore* sem) suspended = 0; TRACE_CUR("acquired PI lock %p, no contention\n", sem); sem->holder = tsk; + + /* don't know if we're global or partitioned. */ sem->hp.task = tsk; + sem->hp.cpu_task[get_partition(tsk)] = tsk; + litmus->inherit_priority(sem, tsk); spin_unlock_irqrestore(&sem->wait.lock, flags); } -- cgit v1.2.2