aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2020-03-07 20:18:44 -0500
committerJoshua Bakita <jbakita@cs.unc.edu>2020-03-07 20:18:44 -0500
commitf523a230da7c2813b03f2e9e1d9d2e8848987052 (patch)
tree443e14f55dc28018889a086f1a233dd18b239c00
parent81afc562527873bad51d12256cb8880dec0b7f1d (diff)
Cleanup, no functional changes
-rw-r--r--litmus/sched_edfsc.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/litmus/sched_edfsc.c b/litmus/sched_edfsc.c
index 9dd30eb60599..5711a09a6c36 100644
--- a/litmus/sched_edfsc.c
+++ b/litmus/sched_edfsc.c
@@ -460,10 +460,7 @@ static noinline void g_job_completion(struct task_struct* t, int forced)
460 460
461 TRACE_TASK(t, "job_completion(forced=%d).\n", forced); 461 TRACE_TASK(t, "job_completion(forced=%d).\n", forced);
462 462
463 /* set flags */
464 tsk_rt(t)->completed = 0; 463 tsk_rt(t)->completed = 0;
465
466 /* unlink */
467 unlink(t); 464 unlink(t);
468 465
469 // When migrating is being removed, or turned into a fixed task 466 // When migrating is being removed, or turned into a fixed task
@@ -491,6 +488,8 @@ static noinline void g_job_completion(struct task_struct* t, int forced)
491 g_preempt_check(); 488 g_preempt_check();
492 } 489 }
493 // When a container job finishes late 490 // When a container job finishes late
491 // XXX: This implementation has diverged from that in container_boundary, the
492 // new code needs to be translated into this block as well or unified.
494 } else if (is_container(t) && tsk_rt(t)->edfsc_params.can_release) { 493 } else if (is_container(t) && tsk_rt(t)->edfsc_params.can_release) {
495 cpu_entry_t* entry = &per_cpu(edfsc_cpu_entries, tsk_rt(t)->edfsc_params.id); 494 cpu_entry_t* entry = &per_cpu(edfsc_cpu_entries, tsk_rt(t)->edfsc_params.id);
496 tsk_rt(t)->edfsc_params.can_release = 0; 495 tsk_rt(t)->edfsc_params.can_release = 0;
@@ -550,7 +549,6 @@ static void g_finish_switch(struct task_struct *prev)
550 cpu_entry_t* entry = this_cpu_ptr(&edfsc_cpu_entries); 549 cpu_entry_t* entry = this_cpu_ptr(&edfsc_cpu_entries);
551 struct task_struct* container = &container_tasks[entry->cpu]; 550 struct task_struct* container = &container_tasks[entry->cpu];
552 BUG_ON(is_realtime(current) && tsk_rt(current)->domain == NULL); 551 BUG_ON(is_realtime(current) && tsk_rt(current)->domain == NULL);
553 //BUG_ON(tsk_rt(container)->scheduled_on != smp_processor_id());
554 552
555 entry->scheduled = is_realtime(current) ? current : NULL; 553 entry->scheduled = is_realtime(current) ? current : NULL;
556 // If we're scheduling a task in a container, set entry->scheduled to the container 554 // If we're scheduling a task in a container, set entry->scheduled to the container
@@ -1135,7 +1133,6 @@ static void edfsc_task_exit(struct task_struct* t)
1135 lt_t now, unaccount_time = 0; 1133 lt_t now, unaccount_time = 0;
1136 cpu_entry_t* entry; 1134 cpu_entry_t* entry;
1137 1135
1138
1139 BUG_ON(is_container(t)); 1136 BUG_ON(is_container(t));
1140 raw_spin_lock_irqsave(&g_lock, flags); 1137 raw_spin_lock_irqsave(&g_lock, flags);
1141 // XXX: Superfluous. We never see `t` as one of our tasks again. 1138 // XXX: Superfluous. We never see `t` as one of our tasks again.
@@ -1161,7 +1158,7 @@ static void edfsc_task_exit(struct task_struct* t)
1161 } 1158 }
1162 1159
1163 /* To preserve EDF-sc scheduling invariants, we can only release a task's 1160 /* To preserve EDF-sc scheduling invariants, we can only release a task's
1164 * utilization at the greater of the period or deadline boundry. Thus, here 1161 * utilization at the greater of completion or deadline boundary. Thus, here
1165 * we schedule a timer to handle this unaccounting of utilization. 1162 * we schedule a timer to handle this unaccounting of utilization.
1166 */ 1163 */
1167 now = litmus_clock(); 1164 now = litmus_clock();
@@ -1233,9 +1230,6 @@ static void edfsc_setup_domain_proc(void)
1233 1230
1234static long edfsc_activate_plugin(void) 1231static long edfsc_activate_plugin(void)
1235{ 1232{
1236 lt_t now;
1237 int i;
1238 now = litmus_clock();
1239 /* TODO This will need to: 1233 /* TODO This will need to:
1240 * - Initialize the containers and container tasks 1234 * - Initialize the containers and container tasks
1241 * (or can that be done at least partially in the module init function? 1235 * (or can that be done at least partially in the module init function?
@@ -1243,12 +1237,10 @@ static long edfsc_activate_plugin(void)
1243 * be reusable if we don't destroy them when the plugin is deactivated) 1237 * be reusable if we don't destroy them when the plugin is deactivated)
1244 * - ... 1238 * - ...
1245 */ 1239 */
1246 for (i = 0; i < num_online_cpus(); i++)
1247 requeue(&container_tasks[i]);
1248 1240
1249 // Start the container boundary timer 1241 // Start the container boundary timer
1250 hrtimer_start(&container_release_timer, 1242 hrtimer_start(&container_release_timer,
1251 ns_to_ktime(now + LITMUS_QUANTUM_LENGTH_NS), 1243 ns_to_ktime(litmus_clock() + LITMUS_QUANTUM_LENGTH_NS),
1252 HRTIMER_MODE_ABS_PINNED); 1244 HRTIMER_MODE_ABS_PINNED);
1253 1245
1254 edfsc_setup_domain_proc(); 1246 edfsc_setup_domain_proc();
@@ -1258,9 +1250,8 @@ static long edfsc_activate_plugin(void)
1258 1250
1259static long edfsc_deactivate_plugin(void) 1251static long edfsc_deactivate_plugin(void)
1260{ 1252{
1261 /* TODO This will need to: 1253 // TODO: Reset our internal state
1262 * - ... 1254
1263 */
1264 // Stop the container boundary timer 1255 // Stop the container boundary timer
1265 hrtimer_cancel(&container_release_timer); 1256 hrtimer_cancel(&container_release_timer);
1266 1257
@@ -1329,7 +1320,6 @@ static int __init init_edfsc(void)
1329 1320
1330 INIT_LIST_HEAD(&pending_adds); 1321 INIT_LIST_HEAD(&pending_adds);
1331 INIT_LIST_HEAD(&migrating_tasks); 1322 INIT_LIST_HEAD(&migrating_tasks);
1332 // TODO
1333 1323
1334 bheap_init(&edfsc_cpu_heap); 1324 bheap_init(&edfsc_cpu_heap);
1335 1325
@@ -1381,6 +1371,7 @@ static int __init init_edfsc(void)
1381 } 1371 }
1382 1372
1383 container_tasks[i].policy = SCHED_LITMUS; 1373 container_tasks[i].policy = SCHED_LITMUS;
1374 requeue(&container_tasks[i]);
1384 1375
1385 // Populate the container_list while we're at it. 1376 // Populate the container_list while we're at it.
1386 container_list[i] = &container_domains[i]; 1377 container_list[i] = &container_domains[i];