diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-05-18 00:24:53 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-05-18 00:24:53 -0400 |
commit | f3270e6022c6f0304e615f99694f071ac1622ad0 (patch) | |
tree | 344b68a1596c5543fb61cbd36efed9c5b7298770 | |
parent | 164b62a38188b7b7d7e82476bab15ca7438f1100 (diff) |
Fix partition handling of PSN-EDF.
-rw-r--r-- | kernel/sched_psn_edf.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kernel/sched_psn_edf.c b/kernel/sched_psn_edf.c index ad28d07c62..8c3c2d81b5 100644 --- a/kernel/sched_psn_edf.c +++ b/kernel/sched_psn_edf.c | |||
@@ -356,7 +356,7 @@ static long psnedf_pi_block(struct pi_semaphore *sem, | |||
356 | psnedf_domain_t* pedf; | 356 | psnedf_domain_t* pedf; |
357 | edf_domain_t* edf; | 357 | edf_domain_t* edf; |
358 | struct task_struct* t; | 358 | struct task_struct* t; |
359 | int cpu = smp_processor_id(); | 359 | int cpu = get_partition(new_waiter); |
360 | 360 | ||
361 | BUG_ON(!new_waiter); | 361 | BUG_ON(!new_waiter); |
362 | 362 | ||
@@ -399,7 +399,7 @@ static long psnedf_pi_block(struct pi_semaphore *sem, | |||
399 | static long psnedf_inherit_priority(struct pi_semaphore *sem, | 399 | static long psnedf_inherit_priority(struct pi_semaphore *sem, |
400 | struct task_struct *new_owner) | 400 | struct task_struct *new_owner) |
401 | { | 401 | { |
402 | int cpu = smp_processor_id(); | 402 | int cpu = get_partition(new_owner); |
403 | 403 | ||
404 | new_owner->rt_param.inh_task = sem->hp.cpu_task[cpu]; | 404 | new_owner->rt_param.inh_task = sem->hp.cpu_task[cpu]; |
405 | if (sem->hp.cpu_task[cpu] && new_owner != sem->hp.cpu_task[cpu]) { | 405 | if (sem->hp.cpu_task[cpu] && new_owner != sem->hp.cpu_task[cpu]) { |
@@ -424,11 +424,11 @@ static long psnedf_inherit_priority(struct pi_semaphore *sem, | |||
424 | */ | 424 | */ |
425 | static long psnedf_return_priority(struct pi_semaphore *sem) | 425 | static long psnedf_return_priority(struct pi_semaphore *sem) |
426 | { | 426 | { |
427 | psnedf_domain_t* pedf = task_pedf(current); | ||
428 | edf_domain_t* edf = task_edf(current); | ||
429 | struct task_struct* t = current; | 427 | struct task_struct* t = current; |
428 | psnedf_domain_t* pedf = task_pedf(t); | ||
429 | edf_domain_t* edf = task_edf(t); | ||
430 | int ret = 0; | 430 | int ret = 0; |
431 | int cpu = smp_processor_id(); | 431 | int cpu = get_partition(current); |
432 | 432 | ||
433 | 433 | ||
434 | /* Find new highest-priority semaphore task | 434 | /* Find new highest-priority semaphore task |
@@ -439,9 +439,11 @@ static long psnedf_return_priority(struct pi_semaphore *sem) | |||
439 | if (t == sem->hp.cpu_task[cpu]) | 439 | if (t == sem->hp.cpu_task[cpu]) |
440 | edf_set_hp_cpu_task(sem, cpu); | 440 | edf_set_hp_cpu_task(sem, cpu); |
441 | 441 | ||
442 | psnedf_exit_np(current); | 442 | psnedf_exit_np(t); |
443 | TRACE_CUR("psnedf_return_priority for lock %p\n", sem); | ||
444 | if (current->rt_param.inh_task) { | 443 | if (current->rt_param.inh_task) { |
444 | TRACE_CUR("return priority of %s/%d\n", | ||
445 | current->rt_param.inh_task->comm, | ||
446 | current->rt_param.inh_task->pid); | ||
445 | spin_lock(&pedf->lock); | 447 | spin_lock(&pedf->lock); |
446 | 448 | ||
447 | /* Reset inh_task to NULL. */ | 449 | /* Reset inh_task to NULL. */ |
@@ -452,7 +454,9 @@ static long psnedf_return_priority(struct pi_semaphore *sem) | |||
452 | preempt(pedf); | 454 | preempt(pedf); |
453 | 455 | ||
454 | spin_unlock(&pedf->lock); | 456 | spin_unlock(&pedf->lock); |
455 | } | 457 | } else |
458 | TRACE_CUR(" no priority to return %p\n", sem); | ||
459 | |||
456 | return ret; | 460 | return ret; |
457 | } | 461 | } |
458 | 462 | ||