diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2013-05-04 12:52:05 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2013-05-04 12:52:05 -0400 |
commit | c999bc50d6f051ec6d3d4e03ee18245e1720f96e (patch) | |
tree | 9579be1c9eea109b291ca44f147d4f3e6e061b26 | |
parent | 520525b6749f208bd90f25cb70cdf0b656b681bf (diff) |
Use initial CPU set by clientwip-semi-part-edfos-jerickso
-rw-r--r-- | litmus/sched_edf_os.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/litmus/sched_edf_os.c b/litmus/sched_edf_os.c index dac2f0e8ca3b..e021d22b5129 100644 --- a/litmus/sched_edf_os.c +++ b/litmus/sched_edf_os.c | |||
@@ -350,7 +350,6 @@ static void change_migrat_cpu_if_needed(struct task_struct *t) | |||
350 | * and the next release | 350 | * and the next release |
351 | */ | 351 | */ |
352 | cpu = next_cpu_for_job(t); | 352 | cpu = next_cpu_for_job(t); |
353 | BUG(); | ||
354 | if (unlikely(cpu != get_partition(t))) { | 353 | if (unlikely(cpu != get_partition(t))) { |
355 | tsk_rt(t)->task_params.cpu = cpu; | 354 | tsk_rt(t)->task_params.cpu = cpu; |
356 | TRACE_TASK(t, "EDF-os: will migrate job %d -> %d\n", | 355 | TRACE_TASK(t, "EDF-os: will migrate job %d -> %d\n", |
@@ -484,27 +483,36 @@ static void edfos_task_new(struct task_struct * t, int on_rq, int running) | |||
484 | edfos_domain_t* edfos = task_edfos(t); | 483 | edfos_domain_t* edfos = task_edfos(t); |
485 | unsigned long flags; | 484 | unsigned long flags; |
486 | unsigned int i; | 485 | unsigned int i; |
487 | unsigned int has_cpu = 0; | ||
488 | 486 | ||
489 | if (edfos_params(t).migrat) { | 487 | if (edfos_params(t).migrat) { |
490 | bheap_init(&edfos_params(t).release_queue); | 488 | bheap_init(&edfos_params(t).release_queue); |
491 | bheap_init(&edfos_params(t).ready_queue); | 489 | bheap_init(&edfos_params(t).ready_queue); |
492 | for (i = 0; i < NR_CPUS_EDF_OS; i++) { | 490 | for (i = 0; i < NR_CPUS_EDF_OS; i++) { |
493 | if (edfos_params(t).fraction[i][0] > 0) { | 491 | if (i == t->rt_param.task_params.cpu) { |
494 | has_cpu = 1; | 492 | /* Initial CPU - setup next release. */ |
493 | edfos_params(t).heap_data[i] = | ||
494 | compute_pfair_release( | ||
495 | edfos_params(t).fraction[i][0], | ||
496 | edfos_params(t).fraction[i][1], 2); | ||
497 | bheap_add(fakepfair_ready_order, | ||
498 | &edfos_params(t).release_queue, | ||
499 | &edfos_params(t).heap_data[i], | ||
500 | GFP_ATOMIC); | ||
501 | } | ||
502 | else if (edfos_params(t).fraction[i][0] > 0) { | ||
503 | /* Non-initial CPU - already released, setup | ||
504 | * deadline. | ||
505 | */ | ||
495 | edfos_params(t).heap_data[i] = | 506 | edfos_params(t).heap_data[i] = |
496 | compute_pfair_deadline( | 507 | compute_pfair_deadline( |
497 | edfos_params(t).fraction[i][0], | 508 | edfos_params(t).fraction[i][0], |
498 | edfos_params(t).fraction[i][1], 0); | 509 | edfos_params(t).fraction[i][1], 1); |
499 | bheap_add(fakepfair_ready_order, | 510 | bheap_add(fakepfair_ready_order, |
500 | &edfos_params(t).ready_queue, | 511 | &edfos_params(t).ready_queue, |
501 | &edfos_params(t).heap_data[i], | 512 | &edfos_params(t).heap_data[i], |
502 | GFP_ATOMIC); | 513 | GFP_ATOMIC); |
503 | } | 514 | } |
504 | } | 515 | } |
505 | BUG_ON(!has_cpu); | ||
506 | /* Pick the first CPU to execute on. */ | ||
507 | change_migrat_cpu_if_needed(t); | ||
508 | } | 516 | } |
509 | 517 | ||
510 | TRACE_TASK(t, "EDF-os: task new, cpu = %d\n", | 518 | TRACE_TASK(t, "EDF-os: task new, cpu = %d\n", |