Add task_cleanup() to scheduler plugin interface
Force LITMUS^RT tasks to become regular Linux tasks before exiting

This reduces the number of ways in which a real-time task can exit to
one (via sched_setscheduler), which makes it easier to avoid nasty
corner cases.
Reimplement sporadic release support

The way the synchronous release code used to set up sporadic releases
is racy. This patch changes the implementation to postpone the
fiddling with the ->release parameter until prepare_for_next_period(),
which is called with the appropriate plugin-specific locks held.
Remove dont_requeue flag

The flag was a hack that never really worked. It shortened the race
window, but didn't close it. With the new sporadic release support, it
should now be superfluous.
Make LITMUS^RT the highest-priority scheduling class again

The existing LITMUS^RT code assumes that it is called as the
highest-priority scheduling class (this was true before stock Linux
gained stop_sched_class). The port to 3.10 changed this, which can
result in rare crashes. This patch makes LITMUS^RT the top scheduling
class again.

Having higher priority than stop_sched_class makes no real sense, but
this was the case in 3.0 also and is required for the existing code to
work correctly.
Postpone deallocation of LITMUS^RT per-task state in sched_setscheduler()
Add config option for linking to local CPU in GSN-EDF

Make it possible to turn of the "always link locally if possible"
latency optimization.

This patch also fixes a bug when local linking is used together with
release master support.

Based on a patch by Felipe Cerqueira (felipec@mpi-sws.org).
C-EDF: add support for CONFIG_PREFER_LOCAL_LINKING

Port the "link locally if possible" latency optimization from GSN-EDF
to C-EDF.
/proc/litmus: Export info. on CPU <-> cluster

This patch adds a framework by which plugins can
export information about CPU <-> cluster (aka
scheduling domain) per cluster.

/proc/litmus/domains/<domain#>: This file contains a CPU
mask describing the CPUs scheduled/managed by that domain.
Files are named by index. For example, the first scheduling
domain would be '0'.

/proc/litmus/cpus/<cpus#>: This file contains a domain
mask describing which domains manage this CPU. Normally,
only one bit will be set in this mask, but overlapping clusters
can also be expressed by setting multiple bits.
sched_plgn: Add fn. for reporting CPU/cluster maps

This patch adds the plugin interface "get_domain_proc_info()".
Plugins use this function to report their cpu/clustering configuration
to the user via /proc/litmus/domains and /proc/litmus/cpus.
Set /proc/litmus/cpus (and domains) on plg activ.

This patch updates the plugin activation routine.
Prior to deactivation, a plugin's data for /proc/litmus/cpus
and /proc/litmus/domains is deactivated/removed.
After successful plugin activation, get_domain_proc_info()
is called on the activated plugin, and the resulting info
is used to configure /proc/litmus/cpus and /proc/litmus/domains.
C-EDF: Export cluster configuration to /proc.

This patch updates C-EDF to support get_domain_proc_info().
G-EDF: Export cluster configuration to /proc

This patch updates G-EDF to support get_domain_proc_info().
PSN-EDF: Export cluster configuration to /proc.

This patch updated PSN-EDF to support get_domain_proc_info().
P-FP: Export cluster configuration to /proc.

This patch updated P-FP to support get_domain_proc_info().
PFAIR: Export cluster configuration to /proc.

This patch updated PFAIR to support get_domain_proc_info().
litmus/P-FP/PCP: Use list_first_entry_or_null() to obtain system ceiling

On an empty list, the list heads next and prev pointers point to
itself. Previous code assumed this was zero and returned the lists
head as a ceiling, leading to undefined behaviour.

Signed-off-by: Roy Spliet <rspliet@mpi-sws.org>
P-FP: remove agent priorities from regular PCP

Due to prior copy&paste reuse, the PCP used agent priorities like in
the DPCP. When using *only* the PCP by itself this is not a problem
(all tasks are similarly treated, which is equivalent to none of the
tasks using agent priorities), but it does look strange and also
prevents the PCP from being used properly together with the DPCP, as
it makes all local resources have DPCP-like ceilings.

This patch removes agent priorities from the PCP. Since the effective
priority of a task is given as a parameter to the PCP implementation,
this does not affect the DPCP implementation.
P-FP: avoid panic in PCP unlock() if lock owner exits

The current BUG_ON() is too strict if a task exits (or ceases to be RT
task while holding a lock). Weaken the assertion to allow this corner
case.
P-FP: document that PCP and DPCP do not handle remote unlock

It is currently not possible to unlock a PCP or DPCP from the "wrong"
core.  In normal operation, this never happens. In a rare corner case,
however, it is conceivable to occur if the following sequence of
events occur:

1) {D}PCP lock()
2) task transitions to background mode
3) task migrates to different core as a best-effort task
4) {D}PCP unlock() <- remote unlock attempt

Fixing this is a bit tricky. For now, let's at least document the
shortcoming and avoid failing silently by adding a corresponding
assertion.