From c999bc50d6f051ec6d3d4e03ee18245e1720f96e Mon Sep 17 00:00:00 2001 From: Jeremy Erickson Date: Sat, 4 May 2013 12:52:05 -0400 Subject: Use initial CPU set by client --- litmus/sched_edf_os.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'litmus') 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) * and the next release */ cpu = next_cpu_for_job(t); - BUG(); if (unlikely(cpu != get_partition(t))) { tsk_rt(t)->task_params.cpu = cpu; 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) edfos_domain_t* edfos = task_edfos(t); unsigned long flags; unsigned int i; - unsigned int has_cpu = 0; if (edfos_params(t).migrat) { bheap_init(&edfos_params(t).release_queue); bheap_init(&edfos_params(t).ready_queue); for (i = 0; i < NR_CPUS_EDF_OS; i++) { - if (edfos_params(t).fraction[i][0] > 0) { - has_cpu = 1; + if (i == t->rt_param.task_params.cpu) { + /* Initial CPU - setup next release. */ + edfos_params(t).heap_data[i] = + compute_pfair_release( + edfos_params(t).fraction[i][0], + edfos_params(t).fraction[i][1], 2); + bheap_add(fakepfair_ready_order, + &edfos_params(t).release_queue, + &edfos_params(t).heap_data[i], + GFP_ATOMIC); + } + else if (edfos_params(t).fraction[i][0] > 0) { + /* Non-initial CPU - already released, setup + * deadline. + */ edfos_params(t).heap_data[i] = compute_pfair_deadline( edfos_params(t).fraction[i][0], - edfos_params(t).fraction[i][1], 0); + edfos_params(t).fraction[i][1], 1); bheap_add(fakepfair_ready_order, &edfos_params(t).ready_queue, &edfos_params(t).heap_data[i], GFP_ATOMIC); } } - BUG_ON(!has_cpu); - /* Pick the first CPU to execute on. */ - change_migrat_cpu_if_needed(t); } TRACE_TASK(t, "EDF-os: task new, cpu = %d\n", -- cgit v1.2.2