From f79d7cdd5ef87f4acb6517e784c6522d7cedd515 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Mon, 17 Oct 2011 18:13:00 -0400 Subject: Added TODOs --- litmus/sched_mc.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c index 84fdc304b434..b43064ab63b6 100644 --- a/litmus/sched_mc.c +++ b/litmus/sched_mc.c @@ -4,6 +4,49 @@ * Implementation of the Mixed Criticality scheduling algorithm. * * (Per Mollison, Erickson, Anderson, Baruah, Scoredos 2010) + * + * Absolute first: relative time spent doing different parts of release + * and scheduling overhead needs to be measured and graphed. + * + * Domain locks should be more fine-grained. There is no reason to hold the + * ready-queue lock when adding a task to the release-queue. + * + * The levels should be converted to linked-lists so that they are more + * adaptable and need not be identical on all processors. + * + * The interaction between remove_from_all and other concurrent operations + * should be re-examined. If a job_completion and a preemption happen + * simultaneously, a task could be requeued, removed, then requeued again. + * + * Level-C tasks should be able to swap CPUs a-la GSN-EDF. They should also + * try and swap with the last CPU they were on. This could be complicated for + * ghost tasks. + * + * Locking for timer-merging could be infinitely more fine-grained. A second + * hash could select a lock to use based on queue slot. This approach might + * also help with add_release in rt_domains. + * + * It should be possible to reserve a CPU for ftdumping. + * + * The real_deadline business seems sloppy. + * + * The amount of data in the header file should be cut down. The use of the + * header file in general needs to be re-examined. + * + * The plugin needs to be modified so that it doesn't freeze when it is + * deactivated in a VM. + * + * The locking in check_for_preempt is not fine-grained enough. + * + * The size of the structures could be smaller. Debugging info might be + * excessive as things currently stand. + * + * The macro can_requeue has been expanded too much. Anything beyond + * scheduled_on is a hack! + * + * Domain names (rt_domain) are still clumsy. + * + * Should BE be moved into the kernel? This will require benchmarking. */ #include @@ -112,7 +155,7 @@ static int cpu_lower_prio(struct bheap_node *a, struct bheap_node *b) } /* - * Return true if the domain has a higher priority ready task. The curr + * Return true if the domain has a higher priority ready task. The @curr * task must belong to the domain. */ static int mc_preempt_needed(struct domain *dom, struct task_struct* curr) @@ -385,6 +428,7 @@ static void link_task_to_cpu(struct cpu_entry *entry, struct task_struct *task) set_rt_flags(task, RT_F_RUNNING); } entry->linked = task; + /* Higher criticality crit entries are now usable */ for (; i < entry_level(entry) + 1; i++) { ce = &entry->crit_entries[i]; @@ -423,8 +467,7 @@ static void preempt(struct domain *dom, struct crit_entry *ce) link_task_to_cpu(entry, task); preempt_if_preemptable(entry->scheduled, entry->cpu); } else if (old && old == entry->linked) { - /* - * Preempted a running task with a ghost job. Null needs to be + /* Preempted a running task with a ghost job. Null needs to be * running. */ link_task_to_cpu(entry, NULL); @@ -449,7 +492,7 @@ static void update_crit_levels(struct cpu_entry *entry) ce = &entry->crit_entries[i]; global_preempted = ce->linked && - /* This task is running */ + /* This task is running on a cpu */ ce->linked->rt_param.scheduled_on == entry->cpu && /* But it was preempted */ ce->linked != entry->linked && @@ -1006,13 +1049,13 @@ static struct task_struct* mc_schedule(struct task_struct* prev) /* Peek at task here to avoid lock use */ while (!cache_next(dom)); + + /* Do domain stuff before grabbing CPU locks */ dtask = dom->peek_ready(dom); + fix_crit_position(ce); raw_spin_lock(&entry->lock); - /* Now that we hold the domain lock...*/ - fix_crit_position(ce); - if (!entry->linked && !ce->linked && dtask && can_use(ce)) { dom->take_ready(dom); link_task_to_crit(ce, dtask); -- cgit v1.2.2