Scheduling Elastic Applications in Compositional Real-Time Systems
Scheduling Elastic Applications in Compositional Real-Time Systems
Scheduling Elastic Applications in Compositional Real-Time Systems
Real-Time Systems
Shaik Mohammed Salman∗† , Saad Mubeen† , Filip Marković† , Alessandro V. Papadopoulos† , and Thomas Nolte†
∗ ABB AB, Västerås, Sweden, shaik.salman@se.abb.com
† Mälardalen University, Västerås, Sweden, {name.surname}@mdh.se
Abstract—Many real-time applications have functional be- capabilities offered by the processors by executing independent
haviour that requires variability in timing properties at run- applications on the same hardware, e.g., running multiple
time. The elastic task model provides a convenient mechanism instances of the robot controller software to control different
to specify and encapsulate such variability and enables the
modification of an application’s periods during run-time to robots on the same processor. Since the execution of inde-
keep the application schedulable. Additionally, reservation-based pendent applications requires temporal and spatial isolation,
scheduling techniques were proposed for the same purpose of the concepts of virtualization and hierarchical scheduling,
taming unpredictability of timing variations, but with a different based on reservations, provide the necessary infrastructure to
solution, i.e., by providing the spatial and temporal isolation for enable such a requirement. While there exist many solutions
executing independent applications on the same hardware.
In this paper, we combine the two approaches by proposing a to schedule adaptive tasks of independent applications in a
two-level adaptive scheduling framework which is based on the hierarchical scheduling approach [6], [7], [8], [9], most of them
elastic task model and the compositional framework based on the focus on modifying the reservation parameters according to
periodic resource model. The proposed framework minimises the the application demands, rather than adapting the application
number of requests for bandwidth adaption at the reservation behaviour to a fixed reservation bandwidth. A disadvantage
(system) level and primarily enables schedulability by accounting
for the application’s elasticity by adjusting the periods. The of modifying the reservation parameters according to the
motivation for this design choice is to rather localise the effect application demands is that the performance of another inde-
of the modifications within the application, without necessarily pendent application co-executing on the same processor may
affecting all the applications at the system level compared to be unnecessarily affected. By making the applications adapt to
the changes made at the application level. The evaluation results a fixed reservation bandwidth, we can limit the impact on other
show that the local application changes may often be enough to
solve the problem of variability, significantly reducing the number applications running on the same processor. However, there
of bandwidth adjustments, and therefore reducing the potential may be instances where the local adaptation of the application
negative impact on all the applications of a system. can fail, e.g., due to insufficient bandwidth, compelling a band-
Index Terms—real-time, elastic task model, reservations, hier- width modification. Therefore, to meet the aforementioned
archical scheduling. requirements, we propose a two-layered adaptive approach to
schedule applications specified according to the elastic task
I. INTRODUCTION model within the compositional real-time framework based on
Many industrial real-time systems such as robot controllers the periodic resource model [10]. Concretely, we address the
have real-time requirements that are flexible to variability following questions:
in execution times of the tasks, and the frequency of the Q1 Given an application with elastic tasks, what is a feasible
task invocations[1]. For instance, Simon et al. [2] provided bandwidth reservation according to the periodic resource
a feedback-based scheduling algorithm for computed torque model?
control of an industrial arm, where the frequency of the dy- Q2 Given a fixed bandwidth reservation according to the
namic compensation tasks, such as that of gravity and Coriolis periodic resource model, how can the elastic application
compensation, was regularly adapted to meet both the control adapt its frequencies to remain schedulable?
objectives as well as the schedulability of the system tasks. Q3 Given an elastic application, can a schedulable reservation
Buttazzo et al. [3] proposed the elastic task model to capture be found if the application requests for a modified band-
such dynamic behaviour of the tasks where the schedulability width reservation?
of the system is managed by adapting the frequencies of
the tasks. Recently, modern system architectures based on We address Q1 by assuming that an application specifies
fog and cloud computing concepts have been proposed to initial desired frequencies for each of its tasks and then uses
improve the performance of robots [4], [5]. A key idea behind those values to identify a feasible bandwidth. We address Q2
such architectures is to exploit the improved computation by modifying the application task frequencies whenever there
is an overload or an application’s task requests a different
frequency such that the application satisfies the schedulability
978-1-7281-2989-1/21/$31.00 ©2021 IEEE conditions under the periodic resource model. We address Q3
by checking if the system-level schedulability is satisfied for TABLE I
the modified bandwidth reservation. A N ELASTIC TASK SET
We provide the system model and discuss the necessary Task ID WCET 𝑇𝑖𝑚𝑖𝑛 𝑇𝑖𝑑 𝑇𝑖𝑚𝑎𝑥 𝑒𝑖
background on elastic tasks and the periodic resource model
𝜏1 4 40 120 240 1
in Section II, followed by the proposed solution in Section III.
𝜏2 7 40 80 360 0.75
We present the evaluation of our approach in Section IV and
𝜏3 10 240 240 480 0.5
the related work in Section V. Finally, Section VI concludes
𝜏4 9 200 240 600 0.25
the paper.
𝜏5 8 40 40 40 0
II. PROPOSED SYSTEM M ODEL
This section presents the system model of the two-level
𝐶 𝐶
compositional scheduling framework for uniprocessor systems. by 𝑈𝑖𝑚𝑖𝑛 = 𝑇 𝑚𝑎𝑥 𝑖
and 𝑈𝑖𝑚𝑎𝑥 = 𝑇 𝑚𝑖𝑛 𝑖
respectively. At run-time,
At the application level, we consider a real-time application 𝑖 𝑖
the utilization of a task is kept as close as possible to a desired
specified according to the elastic task model with implicit 𝐶
utilization 𝑈𝑖𝑑 = 𝑑𝑖 . The desired application utilization is
deadlines(See Section. II-A). We assume that each application ∑ 𝑇𝑖
provides a local scheduler, based on either fixed-priority given by 𝑈 𝑑 = 𝑛𝑖=1 𝑈𝑖𝑑 . Similarly, the minimum and max-
∑
preemptive scheduling implementing Rate Monotonic (RM) imum application utilization is given by 𝑈 𝑚𝑖𝑛 = 𝑛𝑖=1 𝑈𝑖𝑚𝑖𝑛
∑
priority assignment or dynamic-priority preemptive scheduling and 𝑈 𝑚𝑎𝑥 = 𝑛𝑖=1 𝑈𝑖𝑚𝑎𝑥 . If a task requests for a change in its
implementing the Earliest Deadline First (EDF) policy. At the current period, its desired utilization 𝑈𝑖𝑑 is updated. An elastic
system level, we assume that the CPU resource is made avail- application is said to be schedulable if 𝑈 𝑑 ≤ 𝑈 𝑢𝑏 , where 𝑈 𝑢𝑏 is
able to each application according to the Periodic Resource the utilization upper-bound for a given scheduling algorithm. It
Model (PRM) [10](See Section. II-B). is assumed that the deadline is elastic-implicit. i.e., the relative
deadline of each job of an elastic task is equal to its current
A. The Basic Elastic Task Model period at runtime.
Buttazzo et al. [3], [11] proposed the elastic task model Elastic Compression Algorithm: At runtime, if a task
for applications whose tasks can have an adaptive temporal exceeds its execution time or requests for a change in its
behaviour to address overload situations as well as requests period, the application is made schedulable by modifying
for starting new tasks or modifying the task periods. Under the periods of the application’s tasks to accommodate the
this model, whenever there is an overload or a task requests a new values and ensuring that the total utilization of the
new period, the utilization of the remaining tasks is adjusted application’s tasks is below the schedulable utilization bound.
to keep the overall application’s utilization under an upper- This is done according to the original task compression
bound value for a given scheduling algorithm. For example, algorithm proposed by Buttazzo et al. [3] and is reproduced
if the application tasks are scheduled according to EDF, then here as Algorithm 1. It takes as input the elastic application
the application utilization bound is set to 1 and the utilization and the maximum schedulable utilization bound. It computes
values of the individual tasks are adjusted accordingly. While the minimum utilization of the taskset and compares it to
the elastic task model can be applied to applications that have the schedulable utilization bound. If the minimum utilization
computation time variability as well as period variability, in of the elastic application exceeds the schedulable utilization
this paper, we will only consider applications with period bound, it immediately exits and returns a failure. Otherwise, it
variability. iterates through each task of the application and depending on
Formally, we define an elastic application 𝐀 as a set of the elastic coefficients and the current period 𝑇𝑖 of each task, it
𝑛 elastic tasks 𝜏𝑖 = {𝐶𝑖 , 𝑇𝑖𝑚𝑖𝑛 , 𝑇𝑖𝑚𝑎𝑥 , 𝑇𝑖𝑑 , 𝑒𝑖 }, where 𝐶𝑖 is the separates the tasks into two disjoint sets 𝐀𝐟 and 𝐀𝐯 . The set 𝐀𝐟
Worst-Case Execution Time (WCET) of the task 𝜏𝑖 . 𝑇𝑖𝑚𝑖𝑛 contains all the tasks whose utilization values are fixed, i.e.,
and 𝑇𝑖𝑚𝑎𝑥 specify the minimum and the maximum inter-arrival the tasks with elastic coefficients set to 0 and tasks executing
time between consecutive jobs of 𝜏𝑖 . 𝑇𝑖𝑑 represents the desired with their maximum period values. The set 𝐀𝐯 contains the
period of 𝜏𝑖 . The elastic co-efficient 𝑒𝑖 represents the flexibility remaining tasks whose utilization can be varied. Further, 𝑈𝑓
of 𝜏𝑖 to change. For instance, 𝑒𝑖 can be defined to be in the represents the sum of the utilization of the tasks in 𝐀𝐟 , while
range [0, 1], where 𝑒𝑖 = 0 indicates that the 𝑇𝑖𝑚𝑖𝑛 = 𝑇𝑖𝑑 = 𝑇𝑖𝑚𝑎𝑥 𝐸𝑣 represents the sum of the elastic coefficients of tasks in 𝐀𝐯 .
and that this task’s period cannot be modified, and 𝑒𝑖 = 1 For each task in 𝐀𝐯 , its utilization value is scaled according
indicates that the task’s period can be modified to take up to the ratio of the elastic coefficient and the sum of all the
values upto its maximum period. We use 𝑇𝑖 (without any coefficients in 𝐀𝐯 (Line 21). A new task period 𝑇𝑖 is then
postscript) to indicate the current inter-arrival time of 𝜏𝑖 . An assigned to the task. If the new task period exceeds the 𝑇𝑖𝑚𝑎𝑥
example of an elastic taskset is shown in the Table I. while value, it is set equal to 𝑇𝑖𝑚𝑎𝑥 . If this happens, the task 𝜏𝑖 is
the task 𝜏1 can execute at its maximum period, the task 𝜏5 can added to the set 𝐀𝐟 and the process is repeated. The algorithm
only execute at its desired period. returns a feasible taskset if either all the tasks have reached
𝐶
The utilization of a task 𝜏𝑖 is given by 𝑈𝑖 = 𝑇 𝑖 . Further, the their maximum period or if all the tasks’ periods have been
𝑖
minimum and maximum utilization of each task is represented updated such that they are schedulable. We use this algorithm
as a part of our proposed solution (Section III). compositional framework, Given the smallest period of the
application, 𝑇 𝑚𝑖𝑛 , the application is schedulable under RM
Algorithm 1 Task_Compress() scheduling policy if the resource supply utilization satisfies
1: function TASK_COMPRESS(𝐀, 𝑈 𝑢𝑏 ) Eq. (1) (Eq. 23 in [10]).
∑ 𝐶
2: 𝑈 𝑑 = 𝑛𝑖=1 𝑑𝑖
∑
𝑇𝑖 𝑈𝐀
3:
𝐶𝑖
𝑈 𝑚𝑖𝑛 = 𝑛𝑖=1 𝑇 𝑚𝑎𝑥 𝑈Γ,𝑅𝑀 (𝑘) = ( ), (1)
2𝑘+2(1−𝑈𝐀 )
𝑖 log 𝑘+2(1−𝑈𝐀
4: if 𝑈 𝑢𝑏 < 𝑈 𝑚𝑖𝑛 then
5: return Infeasible where,
6: end if
𝑘 = 𝑚𝑎𝑥{𝑘 ∈ ℤ|(𝑘 + 1)Π − Θ < 𝑇 𝑚𝑖𝑛 } (2)
7: OK = 0
8: while OK= 0 do Similarly, the application is schedulable under EDF schedul-
9: 𝑈𝑓 = 0 ing policy if the resource supply utilization satisfies Eq. (3)
10: 𝐸𝑣 = 0 (Eq. 21 in [10]).
11: for each 𝜏𝑖 in 𝐀 do (𝑘 + 2).𝑈𝐀
12: if 𝑒𝑖 == 0 or 𝑇𝑖 == 𝑇𝑖𝑚𝑎𝑥 then 𝑈Γ,𝐸𝐷𝐹 (𝑘) = , (3)
13: 𝑈𝑓 = 𝑈𝑓 + 𝑈𝑖 𝑘 + 2(𝑈𝐀 )
14: else where,
15: 𝐸𝑣 = 𝐸𝑣 + 𝑒𝑖 𝑘Θ
16: end if 𝑘 = 𝑚𝑎𝑥{𝑘 ∈ ℤ|(𝑘 + 1)Π − Θ − < 𝑇 𝑚𝑖𝑛 } (4)
𝑘+2
17: end for
Schedulable Utilization Bounds: Since the main goal of
18: OK = 1
the our solution is to minimize the modifications of the re-
19: for each 𝜏𝑖 in 𝐀𝐯 do
source supply parameters once they have been defined, we rely
20: if 𝐸𝑖 > 0 and 𝑇𝑖 < 𝑇𝑖𝑚𝑎𝑥 then
𝑒𝑖 on the schedulable utilization bounds defined in the Section
21: 𝑈𝑖 = 𝑈𝑖𝑑 − (𝑈 𝑑 − 𝑈 𝑢𝑏 + 𝑈𝑓 ) ∗ 𝐸𝑣 5 of [10] to keep the application schedulable by changing the
𝐶
22: 𝑇𝑖 = 𝑈𝑖 application utilization rather than changing the resource supply
utilization. Accordingly, an application is schedulable under
𝑖
23: if 𝑇𝑖 > 𝑇𝑖𝑚𝑎𝑥 then
24: 𝑇𝑖 == 𝑇𝑖𝑚𝑎𝑥 RM policy, if the application utilization 𝑈𝐀 is less than or
25: OK = 0 equal to the utilization bound 𝐔𝐁𝑅𝑀 (𝑛, 𝑇 𝑚𝑖𝑛 ) as defined in
26: end if Eq. (5) (Eq. 16 in [10]).
27: end if
28: end for [( )1 ]
𝑛
29: end while 2𝑘 + 2(1 − 𝑈Γ )
𝐔𝐁𝑅𝑀 (𝑛, 𝑇 𝑚𝑖𝑛 ) = 𝑈Γ .𝑛 −1 , (5)
30: return Feasible 𝑘 + 2(1 − 𝑈Γ )
31: end function
where
𝑘 = 𝑚𝑎𝑥{𝑘 ∈ ℤ|(𝑘 + 1)Π − Θ < 𝑇 𝑚𝑖𝑛 }
B. Periodic Resource Model
Similarly, an application is schedulable under EDF policy,
Lee et al. [10] proposed the compositional scheduling
if the application utilization 𝑈𝐀 is less than or equal to the
framework based on the periodic resource model to support
utilization bound 𝐔𝐁𝐸𝐷𝐹 (𝑇 𝑚𝑖𝑛 ) as defined in Eq. (6)(Eq. 13
the development of component-based hierarchical software
in [10]).
systems. In this framework, the computational resource is 𝑘𝑈Γ
described as a periodic resource model Γ(Θ, Π), where Θ is the 𝐔𝐁𝐸𝐷𝐹 (𝑇 𝑚𝑖𝑛 ) = , (6)
𝑘 + 2(1 − 𝑈Γ )
periodic resource allocation time and Π is the resource period.
Essentially, the periodic resource Γ provides an application 𝐀 where
with Θ time units of CPU time every Π time units. The worst 𝑘 = 𝑚𝑎𝑥{𝑘 ∈ ℤ|(𝑘 + 1)Π − Θ −
𝑘Θ
< 𝑇 𝑚𝑖𝑛 }
case resource supply of the periodic resource model is shown 𝑘+2
in Fig. 1. The utilization of the resource supply is defined as III. PROPOSED SOLUTION
𝑈Γ = Θ .
Π To schedule an elastic application in a hierarchical schedul-
Generating the Resource Supply Parameters: we use ing framework based on the periodic resource model, we
the method described in Section. 6 of [10] to generate the propose a two-layered adaptive scheduling mechanism that
resource supply parameters Θ and Π, such that an application first attempts to adapt the utilization of the tasks at the
𝐀, modeled as a set of 𝑛 periodic tasks with implicit deadlines, application level and if this adaptation fails, it attempts to
where each task modeled as 𝜏𝑖 = {𝐶𝑖 , 𝑇𝑖 } is schedulable reallocate available spare resource capacity at the system level.
(under EDF or RM scheduling policy). According to the The different components of the proposed framework along
t
kΠ
kΠ − Θ
Π Π Π Π
Θ (Π − Θ) Θ
2(Π − Θ)
with the data flow between them are shown in Fig. 2. At al. [10] in this paper. We assume that Γ(Θ, Π) is schedulable
the application level, it consists of an independent application at the system level. Note that if Γ(Θ, Π) is not schedulable at
defined according to the elastic task model, an elastic manager the system level, then the application will have to modify its
that implements the task compression algorithm of Buttazzo initial desired periods or the resource supply of the other co-
et al. [3]. and a local scheduler implementing either the RM running applications will have to be modified. In our approach,
scheduling policy or the EDF scheduling policy. At the system we reject an application if the initial resource supply is not
level, the Global Compositional Scheduling Resource (GCSR) schedulable.
manager provides the necessary interface for communicating
with the different applications and the functional support for
B. Runtime Adaptation
serving requests of new bandwidth resource allocations from
the individual applications. The functional behaviour of the Under worst-case conditions, the resource supply provided
GCSR manager is supported by the OS or the hypervisor according to PRM can result in a no supply interval of duration
kernel. At the application level, whenever there is an overload 2(Π − Θ) (see Fig. 1). Therefore, once the application is
situation or an elastic task requests for a new period, the elastic executing, whenever a task requests for a new period 𝑇𝑖𝑛𝑒𝑤 ,
manager will try to modify and update the periods of the we need to consider two different scenarios depending on the
rest of the tasks to keep the application schedulable using value of 𝑇𝑖𝑛𝑒𝑤 . If 𝑇𝑖𝑛𝑒𝑤 is greater than the no supply duration,
the Algorithm 1. If the resource supply is insufficient for the we can adapt the tasks utilization at the application level
current demand, the elastic manager generates a new sufficient without changing the resource supply parameters. If 𝑇𝑖𝑛𝑒𝑤 is
resource supply interface and requests the GCSR manager for less than or equal to the no supply duration, we need to adapt
updating the resource supply parameters. The GCSR manager the resource supply at the system level.
will accept the request and responds successfully(i.e., assign a) Application level Adaptation: From Eq. (5) and
new resource supply parameters) if the global system schedu- Eq. (6), it is easy to see that the utilization bound to keep
lability is preserved with the updated parameters. The elastic the application tasks schedulable remains constant as long as
manager will then re-adjust the periods based on the updated 𝑇 𝑚𝑖𝑛 remains unchanged. When the requested period 𝑇𝑖𝑛𝑒𝑤
resource supply parameters. is greater than or equal to 𝑇 𝑚𝑖𝑛 , it implies that the resource
supply parameters do not have to be changed since the current
A. Initial Desired Resource Supply
𝑇 𝑚𝑖𝑛 remains unchanged. As a consequence, and based on
In the proposed framework, we first find the suitable re- the sustainability property of the utilization tests [13], the
source supply Γ(Θ, Π) for the application 𝐀 considering the elastic manager can find a schedulable period reassignment by
parameters 𝜏𝑖 (𝐶𝑖 , 𝑇𝑖 ). We choose as 𝑇𝑖 , the desired periods ensuring that the modified application utilization 𝑈𝐀𝑛𝑒𝑤 remains
for each task. For example, in Table I, The values under below the schedulable utilization bound as shown in Eq. (7)
the column 𝑇𝑖𝑑 represent the initial desired periods of the or Eq. (8). Note that the periodic supply resource utilization
application tasks. We assume that such a taskset is feasible. 𝑈Γ remains constant under application level adaptation.
Next, depending on the scheduling algorithm, we find the
resource supply utilization bound necessary to keep the ap- 𝑈𝐀𝑛𝑒𝑤 ≤ 𝐔𝐁𝐸𝐷𝐹 (𝑇 𝑚𝑖𝑛 ) (7)
plication tasks schedulable according to Eq. (1) and Eq. (3).
While there exist fully polynomial time solutions to find 𝑈𝐀𝑛𝑒𝑤 ≤ 𝐔𝐁𝑅𝑀 (𝑛, 𝑇 𝑚𝑖𝑛 ) (8)
approximate bandwidth allocations for the periodic resource
model, e.g., [12], we use the approach proposed by Lee et
algorithm to find a feasible period reassignment. Before it
Application
calls the task compression algorithm, it modifies the period
parameter of the task from 𝑇𝑖𝑑 to 𝑇𝑖𝑛𝑒𝑤 . The task compression
algorithm then takes as input the updated taskset parameters
new
request(T )
i Elastic update_queue()
Local
Tasks
Manager Scheduler
and the current resource supply utilization 𝑈Γ to adapt the
periods of the tasks to keep the application schedulable. If
𝑇𝑖𝑛𝑒𝑤 is less than 𝑇 𝑚𝑖𝑛 of the application, it sets the 𝑇 𝑚𝑖𝑛
value equal to 𝑇𝑖𝑛𝑒𝑤 . It then generates the new resource supply
request_resource_update(Γ(Θnew , Πnew ))
Global Compositional Scheduling Resource Manager parameters via the GET_RESOURCE_INTERFACE function.
This function takes as input the updated taskset parameters
and the value 𝑘 satisfying Eq. (2) or Eq. (4). It then finds
OS / Hypervisor
the resource supply utilization bound according to Eq. (5)
or Eq. (6). It uses this value to find a solution according
Fig. 2. Data Flow Between The Adaptive Scheduling Framework Compo-
nents.
to the approach given in [10]. The Elastic manager requests
the GCSR manager to modify its resource supply parameters
via the REQUEST_RESOURCE_UPDATE function. The GCSR
b) System Level Adaptation : At runtime, if a task manager tries to allocate resources from the spare capacity
requests for a new period 𝑇𝑖𝑛𝑒𝑤 that is less than 𝑇 𝑚𝑖𝑛 , then while maintaining system schedulability. It returns success if
it is not guaranteed that the existing resource supply Γ can the requested resource supply parameters can be accommo-
provide sufficient CPU time for the application tasks to remain dated or returns failure along with the maximum resource
schedulable. This is because the schedulable utilization bound supply utilization that it can provide. In case of failure, it is
(for both EDF and RM scheduling policy) is a function of up to the application to decide on how to handle this failure.
the minimum period of the taskset and since we are now
reducing the minimum period, it may so happen that the IV. E VALUATION
𝑇𝑖𝑛𝑒𝑤 will have its arrival and deadline in the no supply
interval of duration 2(Π − Θ) in the worst case (see Fig. 1). We evaluate the performance of the proposed framework in
Therefore, whenever a task makes a request of 𝑇𝑖𝑛𝑒𝑤 less the context of EDF scheduling. To demonstrate the advantages
than 𝑇 𝑚𝑖𝑛 , the elastic manager will generate new resource of the proposed method, we generated 900 random tasksets
supply parameters and request the GCSR manager to update with each taskset consisting of 10, 20 or 30 tasks. For each
the resource supply according to the new parameters so that taskset, we set the initial desired utilization equal to 0.25,
the application remains schedulable. If the GCSR manager 0.5, and 0.75. The utilization for each task was then was
rejects the request, then the elastic manager will not be derived using the algorithm proposed by Griffin et al. [16]. The
able to satisfy the application request and it is then up to initial desired periods were chosen at random from a normal
the application to decide how it needs to proceed. If the distribution in the range [10,100]. The WCET values were set
resource supply parameters are updated, the next request for a as 𝐶𝑖 = 𝑈𝑖 ∗ 𝑇𝑖 . The minimum and maximum periods for
period change will be handled based on the updated resource each of the tasks were assigned as a function of the initial
supply parameters. While it is possible to apply the elastic desired period, i.e., to fix the minimum period, we subtracted
task compression algorithm at the system level to modify a random percentage in the range [10-50] from the desired
the resource supply utilization to accommodate the requests period. Similarly, for the maximum period, we added a random
from the different applications, it requires modifications of percentage in the range [10-50] to the desired period. We
the resource supply of the co-running applications which in assigned random integer values from a normal distribution n
turn can trigger application level modifications. To avoid this, the range [0-10] as the elastic coefficients of the tasks. For
we require some spare capacity to be made available at the each taskset, we then derived a periodic resource interface for
system level so that it can be distributed among the different the initial desired periods according to the algorithm in [10].
applications whenever required. Although we do not propose We set up the experiments according to the different con-
any particular method in this paper for the distribution of the figurations of the number of tasks 𝑁 and the total desired uti-
spare capacity, the methods in [14], [15] are particularly well lization 𝑈 , i.e., each configuration was defined as a pair(N,U).
suited for the spare capacity distribution. For each configuration, 100 random tasksets were generated.
c) PRM Elastic Scheduler: We now discuss how the For each configuration and a random taskset, we requested
elastic manager and the GCSR manager work together to a change in the desired period 100 times. For each new
adapt the application as well as system resources to maintain period request, we assigned the new period values chosen
schedulability. The pseudo-code is presented in Algorithm 2. from a uniform distribution within their defined period ranges.
The functional behaviour is split between the elastic manager For each configuration, we counted the number of times the
and the GCSR manager. The Elastic manager takes as input elastic manager was able to modify the utilization such that
the request for 𝑇𝑖𝑛𝑒𝑤 and if 𝑇𝑖𝑛𝑒𝑤 is greater than or equal to the application remains schedulable. If the elastic manager
the 𝑇 𝑚𝑖𝑛 of the application, it uses the elastic compression failed to find a feasible solution, it would adapt the interface
Algorithm 2 PRM Elastic Scheduler was able to successfully handle a higher percentage of requests
1: function GET _ PERIOD _ INTERFACE (𝐀, 𝑇 𝑚𝑖𝑛 ,k) at lower utilization values when compared to higher utilization
2: 𝑈Γ𝑛𝑒𝑤 ← FIND_UTILIZATION_BOUND(𝑈𝐴 ) tasksets. This is shown in Fig. 5. Here, even when compared
3: Γ(Θ𝑛𝑒𝑤 , Π𝑛𝑒𝑤 ) ← FIND_SOLUTION(𝑘, 𝐀, 𝑈Γ𝑛𝑒𝑤 ) to the lower number of tasks with the same total utilization,
4: 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 ← REQUEST_RESOURCE_UPDATE(Γ(Θ𝑛𝑒𝑤 , Π𝑛𝑒𝑤 ))there are more requests for system-level bandwidth adaptation.
5: if 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 == 𝑡𝑟𝑢𝑒 then In another experiment, we modified the range of the min-
6: return Γ(Θ𝑛𝑒𝑤 , Π𝑛𝑒𝑤 ), 𝑈Γ𝑛𝑒𝑤 imum and maximum periods of the taskset from the initial
7: else [10,50] percent values to [10,100] percent. When the differ-
8: return Failure ence between the initial desired period and the minimum and
9: end if maximum periods is increased, fewer requests were handled at
10: end function the application level compared to the system level. As shown
11: function ELASTIC _ MANAGER (𝑇𝑖𝑛𝑒𝑤 ) in Fig. 6, for the configuration of 10 tasks and utilization set
12: 𝑇𝑖𝑑 ← 𝑇𝑖𝑛𝑒𝑤 to 0.25, more than 70% of the requests are for bandwidth
13: if 𝑇𝑖𝑛𝑒𝑤 ≥ 𝑇 𝑚𝑖𝑛 then adaptation when the difference between the minimum and
14: 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 ← TASK_COMPRESS(𝐀, 𝑈Γ ) maximum periods was changed to [10,100] percent from [10-
15: if 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 ! = 𝑡𝑟𝑢𝑒 then 50] percent. Another significant observation is that for certain
16: ℎ𝑎𝑛𝑑𝑙𝑒𝐹 𝑎𝑖𝑙𝑢𝑟𝑒() configurations and tasksets, all of the 100 new period requests
17: end if could either be handled locally by the elastic manager or
18: else handled only at the system level by the GCSR manager. This
19: 𝑇 𝑚𝑖𝑛 ← 𝑇𝑖𝑛𝑒𝑤 can be observed in Fig. 7. This indicates that the approach
20: 𝐼𝑛𝑡𝑒𝑟𝑓 𝑎𝑐𝑒 ← GET_PERIOD_INTERFACE(𝐀, 𝑇 𝑚𝑖𝑛 , 𝑘) based on setting the initial resource supply according to the
21: if 𝐼𝑛𝑡𝑒𝑟𝑓 𝑎𝑐𝑒! = Failure then initial desired periods can have a considerable impact on the
22: 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 ← TASK_COMPRESS(𝐀, 𝑈Γ ) number of requests that need bandwidth adaptations.
23: if 𝑠𝑢𝑐𝑐𝑒𝑠𝑠 ! = 𝑡𝑟𝑢𝑒 then
24: ℎ𝑎𝑛𝑑𝑙𝑒𝐹 𝑎𝑖𝑙𝑢𝑟𝑒()
25: end if 100
Percentage of requests
26: else 80
27: ℎ𝑎𝑛𝑑𝑙𝑒𝐹 𝑎𝑖𝑙𝑢𝑟𝑒()
28: end if 60
29: end if 40
30: return
31: end function 20
0
bandwidth1 . The task requesting for a new period was chosen 0.25 0.5 0.75
at random for each of the new period request. Taskset utilisation
Fig. 3 shows the distribution of requests between the elastic
manager and the GCSR manager for 300 different configura- Elastic Manager GCSR Manager
tions with N equal to 10 and the total utilization set to 0.25,
0.5, and 0.75. We can observe that the elastic manager was Fig. 3. Percentage of requests handled by Elastic and GCSR manager for
able to successfully handle a significantly large percentage of taskset size 10.
the new period requests locally. For lower utilization values,
the percentage of requests handled locally was less than
V. R ELATED WORK
the percentage for the higher utilization. Fig. 4 shows the
distribution of the requests between the elastic manager and The concept of elastic tasks was introduced by Buttazzo
the GCSR manager for 300 configurations with 𝑁 equal to et al. [3] to model applications whose computational demands
20 and the total utilization set to 0.25, 0.5, and 0.75. Similar can occasionally exceed the available capacity by allowing the
to the previous observations, the elastic manager was able to application to modify the demand by changing the frequency
successfully handle a large percentage of the requests locally, of its jobs through an elastic coefficient. This was extended
while for lower utilization values, the percentage was less than to address resource sharing within the elastic task model
the percentage for higher utilization. For the remaining 300 in [11]. Chantem et al. [17], [18] reformulated the problem as
configurations, we set 𝑁 equal to 30 and the total utilization a quadratic optimization problem and showed that the original
was set to 0.25, 0.5, and 0.75. In this case, the elastic manager elastic tasks compression algorithm was indeed a solution to
1 Note that for this evaluation we did not check for system schedulability
solving a quadratic problem. Tian et al. [19] extended the
since a failure of system schedulability test could only mean that the modified problem to include a "Quality-of-Control" metric as
application’s resource demands were not feasible. a part of the objective function of the quadratic optimization
100 100
Percentage of requests
Percentage of requests
80 80
60 60
40 40
20 20
0 0
Fig. 4. Percentage of requests handled by Elastic and GCSR manager for Fig. 6. Percentage of requests handled by Elastic and GCSR manager for
taskset size 20. different intervals between the minimum and the maximum periods.
100
Percentage of requests
80
60
40
20
0