aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* Latest ChangesHEADwip-joshuaZelin Tong2020-07-28
|
* FINAL BUG FIXED VERSIONZelin Tong2020-07-02
|
* Final FixesZelin Tong2020-06-01
| | | | | | | | | Fixed jobs sometimes disappearing due to mysterious path in gschedule where it is not requeued. This is done by first requeueing regardless, and letting unlink dequeue as necessary. Made container_boundary only try to stabilize when new tasks are removed/added to the systed
* Implement background schedulingJoshua Bakita2020-05-17
| | | | | | | | | | | | | | | | | | | | | This turned out to be incredibly complicated. High-level changes are: 1. Container completion in g_job_completion() has been completely reworked. We now check for and appropriately handle all possible states of a background scheduled task. 2. edfsc_cschedule() has had its fixed task scheduling logic overhauled to be easier to follow. This fixes the logic for when a fixed task preempts a background scheduled task, but may also fix other bugs. 3. When a task blocks while being background scheduled, remove that task, NOT the container scheduling that task. 4. Update `entry->scheduled` at the end of edfsc_gschedule(). We will not run g_finish_switch() if we continue scheduling the same task, but we still need entry->scheduled to be updated in the case when we stop background scheduling and switch to normal scheduling. The original code that sets `entry->scheduled` in g_finish_switch() may no longer be needed and further investigation of its removal is encouraged. 5. If a task exits while being background scheduled, remove it from the container rather than `entry->scheduled`.
* Non-logic-changing cleanupJoshua Bakita2020-05-17
| | | | | | | | | Changes are: - Remove broken, commented out code - Remove printk debugging (known to be unreliable) - Name containers with IDs over 9 correctly - Clarify existing and add new TRACE logging calls - Fix inconsistent coding style
* Remove usage of `scheduled_on`Joshua Bakita2020-05-17
| | | | | | This optional portion of `rt_param` was maintained incorrectly, and is actually completely uneeded. It was only in here because we errantly inherited it from GSN-EDF.
* Fix typo in BUG_ON() added by 77882c2dJoshua Bakita2020-05-16
|
* Fix how extra capacity is split between containers and migrating tasksJoshua Bakita2020-05-15
| | | | Based off patch by Peter (Zelin) Tong.
* Fix a BUG_ON(), and port another from Peter's changesJoshua Bakita2020-05-15
| | | | | | | | | | 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.
* Remove superfluous check for blocking in c_release()Joshua Bakita2020-05-15
| | | | | Containers aren't real tasks and thus can't block. Fixed tasks are handled separately.
* Cleanup a few comments and remove an extra lineJoshua Bakita2020-05-15
|
* Fix state when a non-real-time task steals slack from a containerJoshua Bakita2020-05-15
| | | | | | | | | | Otherwise we may call into edfsc_gschedule() with `entry->scheduled` being set to NO_CPU. That state will cause a cascade failure and a panic in the LITMUS^RT core, motivating this fix. We favor setting `scheduled_on` in g_finish_switch() over setting it in edfsc_gschedule(), as `entry->linked` and `entry->scheduled` may be set before edfsc_gschedule() is ever run (ie. during startup).
* Fix the conditions under which we'll immediately migrate a task to a containerJoshua Bakita2020-05-14
| | | | | | | It has to either be finished, not have been released yet, or been suspended due to running out of budget. Originally written by Zelin Tong, only cleaned up in this commmit.
* Remove tasks from `pending_adds` before adding them to `migrating_tasks`Joshua Bakita2020-05-14
| | | | | | Otherwise the list may become corrupted. Also use list_del_init() rather than list_del() so that the list_del() in edfsc_task_exit() is always safe.
* Support waking up blocked tasksJoshua Bakita2020-05-14
| | | | | | | edfsc_task_wake_up() is called when a task becomes unblocked. Since we remove blocked tasks from the system in edfsc_gschedule(), this must be implemented or the previously blocked task will be lost forever.
* Optimize the process of setting `entry->linked` in edfsc_gschedule()Joshua Bakita2020-05-14
| | | | | | | | | | | | | | | | | | | | | | This optimization is based off two observed properties: 1. All of edfsc_gschedule() can handle `entry->linked` being NULL 2. All tasks removed from the ready queue must not be out of budget These invariants allow us to finish this scheduling cycle in one go, rather than restarting when we pull a task off the ready queue. This means that the `goto out` call is not strictly necessary, and can actually put the scheduler in an inconsistent state. This optimization exposed a buggy BUG_ON() call that checked if budget is exhausted without first checking that budget is enforced. That bug is fixed in this commit. This commit also makes the slight optimization that there's no need to call link_task_to_cpu() with NULL if `entry->linked` is already NULL. The removal of the `out:` label also allows for this commit to combine the checks for `is_container(next)`.
* Remove a broken optimization borrowed from GSN-EDF in link_task_to_cpu()Joshua Bakita2020-05-14
| | | | | | | GSN-EDF (which EDF-SC is based off of) tried to reduce migrations by potentially setting `entry->linked` to a CPU other than the one requested in link_task_to_cpu(). In EDF-SC, this may result in containers being linked to the wrong CPU, so remove the optimization.
* Require `g_lock` in g_finish_switch()Joshua Bakita2020-05-14
| | | | | | | | | | | | While Linux will probably never run g_finish_switch() while we're in edfsc_gschedule() on the same core, g_finish_switch() may run simultaneously to an edfsc_gschedule() on a remote core. This may not be safe, as requeue() modifies global data structures and is currently called in g_finish_switch(). Make certain this is safe by obtaining `g_lock` for the whole function. If future refactors remove the requeue() call from this function, it is likely safe to revert this commit.
* General cleanup (does not change sched logic)Joshua Bakita2020-05-14
| | | | | | | | | | - Removes unused code - Adds comments - Rearranges g_preempt_check() to require fewer ifs (no logic change) - Make container IDs print in TRACE messages by setting the `comm` field to the container ID in ASCII during startup - Fixes several TRACE messages which were using GSN-EDF function names - Combines `entry` variables in c_release()
* Scheduler can now schedule (2, 3), (2, 3), (2, 3)Zelin Tong2020-03-08
|
* Fixed acceptance condition test in container_boundaryZelin Tong2020-03-08
| | | | | problem was caused by litmus's fixed point numbers handling negative values in a weird way
* Merge branch 'edfsc-wip' of rtsrv.cs.unc.edu:/public/litmus-rt-edfsc into ↵Zelin Tong2020-03-08
|\ | | | | | | edfsc-wip
| * Manage idle enforcement timer in g_job_completed as recommended by PeterJoshua Bakita2020-03-07
| |
| * Subtract from sys_util and handle signals in edfsc_admit_task()Joshua Bakita2020-03-07
| | | | | | | | | | | | Previously, sys_util held monotonically increasing values. This would cause the system to quickly believe it was saturated and reject all new tasks. It now behaves as expected.
* | Updated logic in utilization trackingZelin Tong2020-03-08
|/
* Unified handling of container releases based off work begun in 1624739aJoshua Bakita2020-03-07
| | | | Fixes the problems mentioned in 1624739a, but for g_job_completion()
* Correct accounting by saving the container_task pointer during edfsc_task_exit()Joshua Bakita2020-03-07
|
* Remove dead code, handle delayed migrations, and fix invalid memory handleJoshua Bakita2020-03-07
| | | | | | | | | As we should never see one of our job completion functions called on a task after it goes through edfsc_task_exit(), simplify that logic to just handle migrations. Also, hold a reference to the task_struct so that it still exists when task_deadline_callback() is called.
* Cleanup, no functional changesJoshua Bakita2020-03-07
|
* Make sure to re-run cschedule if we decide to continue running a containerJoshua Bakita2020-03-07
| | | | | | | | This fixes the issue where deadlines and releases were not being updated. As of this commit, multiple real-time tasks can be created, run simultaneously, be killed, and more tasks can be started and killed on a multicore system - all without crashing or freezing.
* Fix several issues in container_boundary and add documentationJoshua Bakita2020-03-07
| | | | | | | 1. Don't double-add to cpu heap 2. Correctly update linked_on to NO_CPU before linking container 3. Unlink container before requeuing 4. Don't requeue a container that's already queued
* Rewrite the entry->linked logic in edfsc_gscheduleJoshua Bakita2020-03-07
| | | | | | | | | | The old logic was not clear and made more calls than needed. This should be functionally equivalent, except that we don't try to reschedule if we didn't find anything to link. This also adds a BUG_ON to make sure that we don't simultaneously queue and link containers (this is an issue as of this commit, but my next commit will fix that).
* Fix comments, sanity checks, cleanup, and missing or incorrectly ordered ↵Joshua Bakita2020-03-07
| | | | | | spinlocks No functional changes, just some subtle ordering fixes
* Enable and fix fully provisioned containersJoshua Bakita2020-03-07
| | | | Before we could end up trying to do a bogus migration in unlink().
* Fix edfsc_task_new() for multicoreJoshua Bakita2020-03-07
| | | | | | Before we would mess up the container-core partitioning. Now we just trust edfsc_gschedule() to be able to work out the correct state without trying to guess in edfsc_task_new().
* Add comments and sanity checks - no functional changesJoshua Bakita2020-03-07
|
* Updated container budget trackingZelin Tong2020-03-06
|
* Fix edge cases in initialization and state trackingJoshua Bakita2020-03-06
| | | | | | Adds missing allocations in init and starts fixing some bad tracking of container->scheduled in g_finish_switch(), plus some fixes for migrating tasks and background scheduling.
* Fixed contain domain->scheduled trackingJoshua Bakita2020-03-06
| | | | scheduled for container domains is now set to null when container is preempted
* changes to budget tracking and schedulingZelin Tong2020-03-05
| | | | | | consolidated container budget tracking properly excluded fully provisioned containers and their cpus from gedf gschedule no longer returns non-rt tasks
* Merge branch 'edfsc-wip' of rtsrv.cs.unc.edu:/public/litmus-rt-edfsc into ↵Zelin Tong2020-03-05
|\ | | | | | | edfsc-wip
| * Fix lockup after edfsc_task_exit() and improve documentationJoshua Bakita2020-03-04
| | | | | | | | | | This removes a buggy old case that is no longer required since the edfsc_admit_task() rewrite.
* | Fixed calling link_task_to_cpu causing a BUG_ONZelin Tong2020-03-04
|/ | | | | | | | | | This happens because we're not properly scheduling containers to their associated cores and we're not properly keeping track of cpus whose containers are fully provisioned. I fixed the logic for that. Also, I moved around some functions to group them by similar usage and fixed some minor bugs
* Merge branch 'edfsc-wip' of rtsrv.cs.unc.edu:/public/litmus-rt-edfsc into ↵Zelin Tong2020-03-04
|\ | | | | | | edfsc-wip
| * Rewrite edfsc_task_exit(). Task termination now works.Joshua Bakita2020-03-04
| | | | | | | | | | Correcting the deadline timer to not touch potentially invalid memory is still TODO.
* | Fixed Budget tracking and removed excess printkZelin Tong2020-03-04
|/
* Rewrite EDF-sc task admission and fix all build warningsJoshua Bakita2020-03-02
| | | | | | | | | | | | | | | | | | | | | | | | Tasks are no longer unconditionally admitted. Now they suspend until the next container boundry at which we decide if they should be admitted before resuming them. This rewrites edfsc_task_new(), edfsc_admit_task(), and adjusts container_boundary() to wakeup tasks after making admission decisions. container_boundary() and g_job_completion() also contain fixes to correctly clear container->scheduled upon requeue. Finally, this rearranges some printk calls, adds some casts, and removes an unused variable to fix all compiler warnings. PS: This also removes an unconditional BUG() call that should never have been committed. As of this commit, rtspin runs without errors for me. Upon SIGTERM however, edfsc_task_exit() will corrupt the scheduler state and panic the system. SIGSTOP can work as a stand-in for now to demonstrate that the system is still stable.
* Convert sched_edfsc.c to UNIX line ending and use tabs rather than spacesJoshua Bakita2020-03-02
|
* Fix logic in gschedule and cschedule when prev is non-realtimeJoshua Bakita2020-03-02
|
* Various bug fixesZelin Tong2020-02-28
| | | | | | | | | | | Fixed a bug in gschedule where if a non-rt task is scheduled when a container is empty, on reschedule, the scheduler will not check if the container is still empty before resuming the non-rt task Fixed a bug in container_boundary where a container's exec_cost is changed when it should be changed when the container job 'completes' in g_job_completion. This can cause a container job to get extra or less budget if it's tardy