forked from Imagelibrary/seL4
This adds a flags parameter to SchedControl_Configure to enable configuration of a sporadic SC. This also allows flags to be added in the future as needed without breaking the API. This allows the user to configure an SC either to be constrained as a sporadic task where accumulated time is only delayed to when a task has become runnable (implementing the sporadic server algorithm) or whenever the task becomes the current executing task (implementing the sliding-window constraint as in constant-bandwidth servers). This can be used to prevent non-realtime tasks from exceeding bandwidth under any circumstances, even in an over-committed configuration, whilst also allowing work-conserving tasks to be configured in the same system. To implement sporadic servers, we need to ensure that the suspension of a task cannot be used as a mechanism to amplify budget of a task by granting that task access to effectively multiple periods worth of replenishments within a single period. To align the implementation of SCs with the model of sporadic servers we must delay available time until the release of a task. Within seL4, a release would be any time where an SC changes from not being associated with a Running, RunningVM, or Restart thread to one that is. This can occur when an SC is bound to a new thread in such a state or when a thread changes to such a state from any non-running states. Critically, replenishments should not be delayed at the point when an SC becomes the current SC (as was the case prior to this commit). This has the effect of enforcing a continuous, constant bandwidth which is a restriction that is incompatible with standard scheduling logic. Accounting for this requires inserting a new refill_unblock_check call whenever a sporadic SC is unblocked and removing the refill_unblock_check call from when said SC is scheduled. Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
28 lines
871 B
C
28 lines
871 B
C
/*
|
|
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
#include <autoconf.h>
|
|
#include <sel4/types.h>
|
|
#include <sel4/macros.h>
|
|
#include <sel4/invocation.h>
|
|
#include <sel4/constants.h>
|
|
#include <interfaces/sel4_client.h>
|
|
|
|
/*
|
|
* This file specifies virtual implementations of older invocations
|
|
* that can be aliased directly to new invocations.
|
|
*/
|
|
|
|
#ifdef CONFIG_KERNEL_MCS
|
|
LIBSEL4_INLINE seL4_Error seL4_SchedControl_Configure(seL4_SchedControl _service, seL4_SchedContext schedcontext,
|
|
seL4_Time budget, seL4_Time period, seL4_Word extra_refills, seL4_Word badge)
|
|
{
|
|
return seL4_SchedControl_ConfigureFlags(_service, schedcontext, budget, period, extra_refills, badge,
|
|
seL4_SchedContext_NoFlag);
|
|
}
|
|
#endif
|