diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-05-15 15:33:13 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-05-15 15:33:13 -0400 |
commit | 77882c2dfcf1b849252e65624212be2efa93063f (patch) | |
tree | bc410ebf1096ec0c7e75e39e581f965b2350876a | |
parent | bc7478ac9601c1d18bb2ffbb168747d964b7f283 (diff) |
Fix a BUG_ON(), and port another from Peter's changes
For background scheduled, migrating tasks without budget enforcement
enabled, we had a BUG_ON() statement that could errantly fire. Fix
it by checking that budget is enforced first. Also move it to a more
general location.
This also adds a BUG_ON() to link_task_to_cpu() to make sure that
containers are never linked to the wrong core.
-rw-r--r-- | litmus/sched_edfsc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/litmus/sched_edfsc.c b/litmus/sched_edfsc.c index 97cead918890..3cc4d4d65b08 100644 --- a/litmus/sched_edfsc.c +++ b/litmus/sched_edfsc.c | |||
@@ -253,6 +253,7 @@ static noinline void link_task_to_cpu(struct task_struct* linked, | |||
253 | { | 253 | { |
254 | BUG_ON(linked && !is_realtime(linked)); | 254 | BUG_ON(linked && !is_realtime(linked)); |
255 | BUG_ON(is_fixed(linked)); | 255 | BUG_ON(is_fixed(linked)); |
256 | BUG_ON(is_container(linked) && task_rt(linked)->edfsc_params.id != entry->cpu); | ||
256 | 257 | ||
257 | /* Currently linked task is set to be unlinked. */ | 258 | /* Currently linked task is set to be unlinked. */ |
258 | if (entry->linked) | 259 | if (entry->linked) |
@@ -755,10 +756,11 @@ static struct task_struct *edfsc_gschedule(struct task_struct *prev) | |||
755 | g_job_completion(entry->scheduled, !sleep); | 756 | g_job_completion(entry->scheduled, !sleep); |
756 | else | 757 | else |
757 | unlink(entry->scheduled); | 758 | unlink(entry->scheduled); |
758 | // Both branches of the above should clear entry->linked | ||
759 | BUG_ON(entry->linked && budget_exhausted(entry->linked)); | ||
760 | } | 759 | } |
761 | 760 | ||
761 | // We should have descheduled globally scheduled tasks without budget by now | ||
762 | BUG_ON(entry->linked && budget_enforced(entry->linked) && budget_exhausted(entry->linked)); | ||
763 | |||
762 | // Determine what to run next (set entry->linked) | 764 | // Determine what to run next (set entry->linked) |
763 | if (!entry->linked) { | 765 | if (!entry->linked) { |
764 | struct task_struct* task = __take_ready(&gsched_domain); | 766 | struct task_struct* task = __take_ready(&gsched_domain); |