diff options
author | Glenn Elliott <gelliott@koruna.cs.unc.edu> | 2010-02-11 14:01:41 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@koruna.cs.unc.edu> | 2010-02-11 14:01:41 -0500 |
commit | 2cc9eeaa471deef3dc8e4cc917f026249e77b441 (patch) | |
tree | ee71238af3264847a8479f01c7aafe57a318424c | |
parent | 851baec36d80e7ee279c69677b113428d20562c8 (diff) |
Fixed two bugs:
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.
-rw-r--r-- | include/litmus/sched_plugin.h | 2 | ||||
-rw-r--r-- | litmus/fmlp.c | 4 | ||||
-rw-r--r-- | litmus/sched_psn_edf.c | 1 |
3 files changed, 5 insertions, 2 deletions
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 { | |||
12 | atomic_t count; | 12 | atomic_t count; |
13 | int sleepers; | 13 | int sleepers; |
14 | wait_queue_head_t wait; | 14 | wait_queue_head_t wait; |
15 | union { | 15 | struct { |
16 | /* highest-prio holder/waiter */ | 16 | /* highest-prio holder/waiter */ |
17 | struct task_struct *task; | 17 | struct task_struct *task; |
18 | struct task_struct* cpu_task[NR_CPUS]; | 18 | 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) | |||
180 | suspended = 0; | 180 | suspended = 0; |
181 | TRACE_CUR("acquired PI lock %p, no contention\n", sem); | 181 | TRACE_CUR("acquired PI lock %p, no contention\n", sem); |
182 | sem->holder = tsk; | 182 | sem->holder = tsk; |
183 | |||
184 | /* don't know if we're global or partitioned. */ | ||
183 | sem->hp.task = tsk; | 185 | sem->hp.task = tsk; |
186 | sem->hp.cpu_task[get_partition(tsk)] = tsk; | ||
187 | |||
184 | litmus->inherit_priority(sem, tsk); | 188 | litmus->inherit_priority(sem, tsk); |
185 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 189 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
186 | } | 190 | } |
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index 4829653b8f76..7b0740b1c58a 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -376,7 +376,6 @@ static long psnedf_pi_block(struct pi_semaphore *sem, | |||
376 | 376 | ||
377 | spin_unlock(&pedf->slock); | 377 | spin_unlock(&pedf->slock); |
378 | } | 378 | } |
379 | TRACE_TASK(sem->holder, "psnedf_pi_block\n"); | ||
380 | 379 | ||
381 | return 0; | 380 | return 0; |
382 | } | 381 | } |