| Commit message (Collapse) | Author | Age |
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
Based off patch by Peter (Zelin) Tong.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Containers aren't real tasks and thus can't block. Fixed tasks are
handled separately.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)`.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
- 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()
|
| | |
|
| |
|
|
|
| |
problem was caused by litmus's fixed point numbers handling
negative values in a weird way
|
| |\
| |
| |
| | |
edfsc-wip
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
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.
|
| |/ |
|
| |
|
|
| |
Fixes the problems mentioned in 1624739a, but for g_job_completion()
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
| |
spinlocks
No functional changes, just some subtle ordering fixes
|
| |
|
|
| |
Before we could end up trying to do a bogus migration in unlink().
|
| |
|
|
|
|
| |
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().
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
| |
scheduled for container domains is now set to null when container is preempted
|
| |
|
|
|
|
| |
consolidated container budget tracking
properly excluded fully provisioned containers and their cpus from gedf
gschedule no longer returns non-rt tasks
|
| |\
| |
| |
| | |
edfsc-wip
|
| | |
| |
| |
| |
| | |
This removes a buggy old case that is no longer required since
the edfsc_admit_task() rewrite.
|
| |/
|
|
|
|
|
|
|
|
| |
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
|
| |\
| |
| |
| | |
edfsc-wip
|
| | |
| |
| |
| |
| | |
Correcting the deadline timer to not touch potentially invalid
memory is still TODO.
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|