<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luca Abeni</string-name>
          <email>luca.abeni@unitn.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giuseppe Lipari</string-name>
          <email>g.lipari@sssup.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Juri Lelli</string-name>
          <email>j.lelli@sssup.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Scuola Superiore Sant'Anna</institution>
          ,
          <addr-line>Piazza Martiri della Libertà 33, 56127 Pisa</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Scuola Superiore Sant'Anna</institution>
          ,
          <addr-line>Piazza Martiri della Libertà 33, 56127 Pisa</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Trento</institution>
          ,
          <addr-line>Via Sommarive 9, Povo, 38123 Trento</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2014</year>
      </pub-date>
      <abstract>
        <p>The Constant Bandwidth Server (CBS) is an algorithm for providing temporal protection and real-time guarantees to real-time sporadic tasks. Recently, an implementation of this algorithm called SCHED_DEADLINE has been included in the Linux kernel. Therefore, the CBS algorithm is now used to serve more generic tasks than do not obey to the classical sporadic task model. One important type of tasks which was not considered by the original CBS algorithm is the so called “self-suspending task model”, where a task instance can suspend itself waiting for an external event. Even if the original algorithm is adapted so that the temporal protection property continues to hold, it is difficult for developers to provide guarantees and to select the most appropriate server parameters for such tasks. This paper investigates the problem of using the CBS algorithm for serving self-suspending tasks, by analysing it from a theoretical point of view and showing how to select the server parameters (budget and periods) for self-suspending tasks. Finally, the effectiveness of these proposals is shown through both simulations and real experiments on Linux / SCHED_DEADLINE.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>This work has been partially supported by the 7th
Framework Programme JUNIPER (FP7-ICT-2011.4.4) project,
founded by the European Community under grant
agreement n. 318763.
a regular/periodic activation/execution pattern. Moreover,
the CBS allows tasks to execute earlier (consuming some of
their future reserved time) if there is enough idle time in the
system.</p>
      <p>
        The CBS algorithm also provides real-time guarantees to
sporadic real-time tasks that respect the so-called Liu and
Layland task model [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]: if every task is assigned a budget
larger than its worst-case execution time and a server period
smaller than the minimum inter-arrival time between two
instances, then every instance of the task is guaranteed to
complete before its deadline. This property is called Hard
Schedulability.
      </p>
      <p>
        For real-time applications, the temporal protection property
is as important as the traditional memory protection (or
address space protection) mechanism provided by
generalpurpose Operating Systems (OSs). As a matter of fact, some
general-purpose OS kernels started to use some temporal
protection mechanisms to bound the amount of execution
time used by fixed priority (real-time) processes or threads.
For example, the Linux kernel provides a mechanism called
RT throttling to avoid the risk that a high-priority real-time
process starves all the other applications in the system. It
can be considered as a first necessary step to allow non
privileged users to use real-time priorities. Although RT
throttling is useful in many situations and can achieve its goals
in general, it lacks a strong theoretical foundation; hence, it
is not possible to provide a complete schedulability analysis.
Moreover, processes or threads characterised by aperiodic /
irregular arrival / execution patterns can end up consuming
more CPU time than expected, compromising the real-time
performance of the other ones (because, for example, of the
infamous deferrable server problem [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]: the utilisation of a
deferrable server is larger than the ratio between runtime
and period).
      </p>
      <p>
        To address this issue, and to allow the predictable
execution of real-time application without starving the non
realtime ones, an implementation of the CBS algorithm, named
SCHED_DEADLINE [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], has been recently included in the
mainline Linux kernel (and is available without having to patch
the kernel since version 3.14).
      </p>
      <p>Thanks to SCHED_DEADLINE, it is possible to use the CBS to
schedule every application that can run on a Linux-based
OS, including applications that were not originally
developed with the Liu and Layland task model in mind. Of
course, this fact provides new interesting possibilities, but
also raises some issues: how to provide real-time
guarantees to such tasks (which do not respect the original Liu
and Layland model)? How to assign the CBS parameters to
them?
One important task model which was not considered by the
original CBS is the self-suspending task model, in which tasks
can self-suspend waiting for external events. For example,
a task may suspend waiting for the response of a
hardware device, the response of a server or from a co-processor.
Tasks that make use of the GPU can be typically
modelled as self-suspending tasks. The CBS algorithm and the
SCHED_DEADLINE implementation, interpret every suspension
as an end-of-instance; therefore, it is difficult to provide
guarantees to self-suspending tasks scheduled by the CBS
algorithm, and it is not easy to select the most appropriate
budget and period for such tasks.</p>
      <p>
        While the problem of analysing self-suspending tasks has
already been addressed in the real-time systems literature
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], we are not aware of other papers that address the same
problem in the context of resource reservation algorithms
like the CBS.
      </p>
      <p>In this paper, we address this problem first from the
theoretical point of view: after recalling the algorithm in Section 2,
we propose one alternative rule for the algorithm in Section
2.2. Moreover, in Section 3 we analyse the problem of setting
the CBS parameters for a self-suspending task. In Section
4 we show a set of simulation experiments on synthetically
generated tasks set to evaluate the proposed methodology.
Finally in Section 5 we discuss related work, and in Section
6 we present our conclusions.</p>
    </sec>
    <sec id="sec-2">
      <title>2. REVISITING THE CBS</title>
      <p>The original CBS algorithm has been designed to schedule
real-time tasks which can be described by the so-called “Liu
and Layland real-time task model” (each real-time task can
be modelled as sequences of jobs that never block). In this
section, after quickly recalling the original model and
algorithm, we show how the original CBS can be easily modified
to serve real-time tasks that do not respect such a strict
model.</p>
    </sec>
    <sec id="sec-3">
      <title>2.1 Original Task Model and Algorithm</title>
      <p>Traditionally, a real-time task τi is modelled as a stream of
jobs Ji,j , with the jth job of the task (named Ji,j ) arriving
(becoming ready for execution) at time ri,j , executing for a
time ci,j and finishing at time fi,j . Each job is also
characterised by an absolute deadline di,j which is respected if
fi,j ≤ di,j . Notice that job Ji,j never blocks, so it is ready
for execution from time ri,j to time fi,j .</p>
      <p>Based on these definitions (which characterise the
previously mentioned “Liu and Layland real-time task model”),
the CBS algorithm was defined as follows:
1. A real-time task τi can be associated to a CBS
(representing a CPU reservation) in order to schedule it
2. The CBS associated to task τi is characterised by a
budget qis and by an ordered pair (Qis, Tis), where Qi
s
is the maximum budget and Tis is the so called server
period (or reservation period). A scheduling deadline
dis is also associated to the CBS
3. The CBS associated to task τi is said to be active at
time t if there are pending jobs for task τi; that is, if
there exist a job Ji,j such that ri,j ≤ t &lt; fi,j . A CBS
is said to be idle if it is not active
4. When a job Ji,j of a task τi served by an active CBS
arrives, a request is enqueued
5. When a job Ji,j of a task τi served by an idle CBS
arrives, if qis ≥ (dis − ri,j) QTsis then the CBS generates
i
a new scheduling deadline dis = ri,j + Tis and the
budget is recharged to the maximum value Qis: qis = Qis.
Otherwise, the job is served with the current
scheduling deadline and budget
6. Whenever a task τi served by a CBS executes for a time
δ, the budget qis is decreased accordingly: qis = qis − δ
7. When qis = 0, it is recharged to the maximum value
s
Qi , and the scheduling deadline is postponed by one
server period Tis: qis = Qis, dis = dis + Tis
8. When a job finishes, the next pending job for the task,
if any, is served using the current budget and
scheduling deadline. If there are no pending jobs, the CBS
becomes idle.</p>
      <p>According to these rules, every active real-time task is
ass
signed a scheduling deadline di , which is used by an EDF
scheduler to decide which task to execute at any time
instant.</p>
      <p>
        If U = Pi QTsis ≤ 1, it can be proved that the finishing time
i
of every job will be smaller than the scheduling deadline of
the task at the instant of the job completion (see Theorem
1 in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]). Since the values of the scheduling deadline dis only
depends on the parameters of the served task τi (that is,
on the execution and arrival times of τi’s jobs) and on the
assigned CBS parameters (budget Qis and server period Tis),
it is possible to prove that the worst-case behaviour of task
τi does not depend on the behaviour of the other tasks (see
Lemma 1 in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]). This is known as temporal protection (or
temporal isolation) property.
      </p>
      <p>
        Thanks to this temporal protection property provided by the
CBS algorithm, it is possible to ensure that all the deadlines
of all the jobs of task τi will be respected by setting Qis ≥
maxj {ci,j } and Tis ≤ minj{ri,j+1 − ri,j}. This is known as
hard schedulability property. It is also possible to perform a
stochastic/probabilistic analysis to provide an upper bound
for the probability of missed deadlines for each single task
τi [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
    </sec>
    <sec id="sec-4">
      <title>2.2 Self-Suspending Tasks</title>
      <p>As already mentioned, the algorithm description presented
above (which is basically the original CBS) assumes that
each real-time task τi served by a CBS blocks only when a
job finishes, and then wakes up when the next job arrives.
Examples can be a periodic task that only blocks waiting for
a periodic timer (which is used to activate the various jobs)
or a sporadic task that only blocks waiting for the event
that activates the next job. For these tasks, a job Ji,j can
be described by its arrival time ri,j, its deadline di,j , and its
execution time ci,j .</p>
      <p>There are two reasons for this assumption. The first one is
the simplicity of implementation in the kernel: every time
the task blocks the kernel interprets this event as end-of-job;
and every time the task is unblocked, the kernel interprets
is as a new job activation. The second reason concerns the
behaviour of the algorithm: if a job blocks on some other
event different from a job completion (for example, on a file
descriptor waiting for data coming from an external device),
the scheduler has to be modified to properly handle this
situation so that the CBS properties are not broken. In
particular, if the remaining budget and scheduling deadline
are not correctly updated the temporal protection property
risks to be broken.</p>
      <p>However, although the original assumption about non
selfsuspending jobs can help in simplifying the scheduler, it is
not realistic in practice: a job Ji,j of a real task τi might
block (even multiple times) before finishing, hence
describing its execution through a single execution time ci,j might
be too simplistic. A more realistic task model considers
selfsuspending tasks, where job Ji,j executes for a time ci0,j ,
then blocks for a time si0,j, executes for a time ci1,j, blocks
for a time si1,j , etc... In other words, Ji,j is composed by ki,j
different segments, having execution times ci0,j . . . cik,ij,j , and
between segment h and segment h + 1 the job sleeps for a
time sih,j.</p>
      <p>In order to be really usable in practice, a modern CBS
implementation (such as SCHED_DEADLINE) has to correctly
support self-suspending tasks, hence both the two problems
mentioned above have to be addressed. As a result, it is
important to understand how to adjust the budget and the
scheduling deadline when a job of the task blocks and
unblocks (between two consecutive segments). A first idea
could be to use the original CBS “wake up rule” (rule 5)
for all the wake-ups (even if a new job is not arrived). Such
a rule, which was used by the original CBS algorithm only
when a new job Ji,j arrives (at time ri,j ) performs the
following check:
s
qis ≥ (dis − ri,j) QTsi .</p>
      <p>
        i
If the condition holds, it is necessary to compute a new
budget and a new scheduling deadline, otherwise the old ones
can be re-used without compromising the CBS properties
[
        <xref ref-type="bibr" rid="ref1 ref3">1, 3</xref>
        ].
      </p>
      <p>The rule can be informally explained as follows: the
scheduler checks if the fraction of CPU time that the job will use
f(rgoivmennbowy tthoe tchuerrsecnhtebduudlignegt dqiseaddilvinidee)disbylatrhgeertitmheandisQT−sisrio,jr
not:</p>
      <p>s
qis ≥ (dis − ri,j) QTsi ⇒
i</p>
      <p>qis
dis − ri,j</p>
      <p>s
≥ Qi</p>
      <p>Tis
If this condition is true, then the task cannot be
scheduled using the current scheduling deadline and the current
(1)
i
(2)
budget, because it would consume a fraction of CPU time
larger than Qis/Tis, breaking the temporal protection
property. The solution used in the original paper was to generate
a new scheduling deadline dis = ri,j + Tis and a new budget
qis = Qis so that the condition is verified.</p>
      <p>When considering self-suspending tasks, the same deadline
assignment rule can be re-used to check if the current
scheduling deadline dis and budget qis can be used when a job wakes
up at time t (at the beginning of a new segment).
However, other approaches could also be used. For example, it
is possible to set
s
qis = (dis − t) QTsi
i
(3)
and leave dis unchanged thus preserving the bandwidth limit.
This will be referred as revised wake-up rule in the rest of
the paper.</p>
      <p>The solution adopted in the original paper makes sense for
new job arrivals (because it tries to associate a new deadline
equal to ri,j + Tis to each job), but can have bad effects on
the task’s response times when other kinds wake-ups
happen. The revised wake-up rule discussed above (decrease the
current budget leaving the scheduling deadline unchanged),
instead, could be more useful when the wake-up does not
correspond to a new job arrival, because it allows to
continue serving the current job with the current scheduling
deadline.</p>
    </sec>
    <sec id="sec-5">
      <title>3. ANALYSIS</title>
      <p>
        When considering only non self-suspending tasks,
configuring the CBS parameters Qis and Tis is pretty simple: for
example (as already mentioned) if Qis ≥ maxj{ci,j } and
Tis ≤ minj{ri,j+1 − ri,j} then the deadlines of all the jobs
Ji,j of task τi will be respected (regardless of the behaviours
of all the other tasks running in the system). In particular,
for periodic tasks τi with ri,j+1 −ri,j = Pi it is possible to set
Tis = Pi. Although smaller values of Tis are sometimes used
when performing stochastic analysis [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] or adaptive
scheduling [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], Tis = Pi is generally preferred in order to reduce the
number of context switches and the resulting overhead.
However, when considering self-suspending tasks assigning
the CBS parameters might require more care. In order to
better understand how to properly schedule a self-suspending
task using the CBS algorithm, consider the simplest
example of periodic self-suspending task, in which every job has
only 2 segments: each job Ji,j of the task executes for a
time ci0,j , then sleeps for a time si,j , executes for a time ci,j
1
and finally finishes. If the server period Tis is set equal to
Pi, the only thing that can be guaranteed about the
execution of the first segment of Ji,j is that it will finish before
t′ = ri,j + ⌈ci0,j /Qis⌉Tis − Qis + (ci0,j %Qis). Hence, the job will
sleep from t′ to t′+si,j and the second segment of the job will
start at t′′ = t′ + si,j. Even when considering Qis &gt;&gt; ci0,j ,
in the worst case the second segment of the job will start at
time
t′′ = ri,j + Tis − Qis + ci0,j + si,j
(4)
which if Tis = Pi and ci0,j + si,j &gt; Qis is larger than di,j =
ri,j +Pi = ri,j +Tis. Since the actual start time of the second
segment of Ji,j (as opposed to the worst-case start time) will
depend on the execution of the other tasks in the system,
in this case the temporal protection property is not useful
to provide real-time performance guarantees to the task. In
this case, the difference between the two different “wake-up
rules” presented in the previous section does not affect the
worst-case performance of the tasks, but only the average
performance.
      </p>
      <p>Hence, in order to have a better control on the worst-case
real-time performance of self-suspending real-time tasks
scheduled by a CBS it could be useful to set Tis &lt; Pi; in particular,
Tis = Pi/R, with R ∈ N .</p>
      <p>Reducing the value of Tis (while keeping the ratio Qis/Tis
constant), it is possible to have a better control on the
jobs’ response times (at the cost of a larger number of
preemptions). In particular, when Tis → 0 (and consequently
Qis → 0) the finishing time for the job becomes:</p>
      <p>Tis,Qis→0 ri,j +
lim
0
ci,j
Qs</p>
      <p>i
+
1
ci,j
Qs
i
Tis − Qis + (ci0,j %Qis) + si,j</p>
      <p>Tis − Qis + (ci1,j%Qis) =</p>
      <p>0 1
= ri,j + cQi,sj Tis + si,j + cQi,sj Tis
i i
because Tis → 0 ⇒ Qis → 0, Tis → 0 ⇒ ⌈ci0,j /Qis⌉ → ci0,j /Qis,
and Tis → 0 ⇒ ci0,j %Qs → 0. This is the so called “fluid flow
execution model”, according to which every task executes in
parallel with the other tasks at a speed Qis/Tis. Notice that
the fluid flow execution model is a mathematical
abstraction which is not reasonable in practice (Tis → 0 makes no
sense in a real system), but provides interesting results for
comparison.</p>
      <p>According to this model, the first segment of the job executes
0 s
in ci,j (Tis/Qi ) time units, so the second segment starts a
time t′′ = ri,j + ci0,j (Tis/Qis) + si,j and the job finishes at
time
ri,j + ci0,j QTiss + si,j + ci1,j QTiss = (ci0,j + ci1,j ) QTiss + si,j (5)
i i i
If Cih = maxj{cih,j } and Si = maxj{si,j }, then it is possible
to say that in the (ideal) fluid flow execution model each job
would respect its deadline if</p>
      <p>s
QTsi =
i</p>
      <p>Ci0 + Ci</p>
      <p>1</p>
      <p>Pi − Si
hence in a real system (with Tis = Pi/R &gt;&gt; 0) the ratio
between the CBS maximum budget Qis and the server period
Tis should be larger than (Ci0 + Ci1)/(Pi − Si).</p>
      <p>Notice that the discussion above has been performed
considering only two segments, but can be generalised: in case
of tasks with segments 0...k,</p>
      <p>s
QTsi ≥
i</p>
      <p>Pkh=0 Cih
Pi − Pkh−=10 Sih
(6)
(7)
2.5
s
ilnde 2
a
e
d
d
e
s
ism 1.5
f
o
e
g
a
t
rcen 1
e
P
0.5
0
0.6
0.65
0.7
0.75 0.8</p>
      <p>Utilisation
0.85
0.9
0.95</p>
    </sec>
    <sec id="sec-6">
      <title>4. EXPERIMENTAL RESULTS</title>
      <p>
        The suitability of the CBS algorithm (with the two different
“wake-up rules” described in this paper and with different
Pi/Tis values) has been tested through a large set of
simulations and real experiments (based on SCHED_DEADLINE).
Both simulations and real experiments have been performed
by using some randomly generated sets of traditional and
self-suspending real-time tasks. In order to generate such
task sets, taskgen [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] has been used to generate a set of
(Ci, Pi) pairs with a given utilisation U = Pi Ci/Pi. The
algorithm generates N randomly distributed numbers Ui ∈
(0, 1), whose sum is equal to the desired system utilisation:
Pi Ui = U . Then, the periods Pi are randomly generated
according to a uniform distribution in [10ms, 100ms] and Ci
are set equal to the task utilisation multiplied by the task
period: Ci = UiPi. Some of the pairs are interpreted as
“traditional” (non self-suspending) periodic tasks τi = (Ci, Pi),
served by CBSs (Qis = Ci, Tis = Pi), while the remaining
pairs represent self-suspending tasks with jobs composed by
2 segments. For each one of these pairs, a sleeping time Si is
randomly generated with a uniform distribution between 0
and 2/3Pi; then the execution time Ci0 of the first segment is
randomly generated with a uniform distribution between 0
and (Pi−Si)Ci/Pi. Finally, the execution time Ci1 of the
second segment is computed as Ci1 = (Pi −Si)Ci/Pi −Ci . Each
0
self-suspending task is served with a CBS (Qis = Ci/R, Tis =
Pi/R), with R = 1, 2, 3, 4. Since these assignments respect
Equation 7, a fluid flow schedule would not cause any missed
deadline. However, since Tis &gt; 0 some missed deadlines can
be expected, and the next experiments evaluate the impact
of R and of the wake-up rule on such missed deadlines.
      </p>
    </sec>
    <sec id="sec-7">
      <title>4.1 Simulations</title>
      <p>
        The simulations have been performed by using RTSim [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ],
generating 50 sets of tasks for each N, U configuration (where
N is the number of tasks and U is the system utilisation).
As an example, Figure 1 shows the probability to miss a
deadline (expressed as a percentage) when considering 1
CPU, N = 6 tasks, and different values of the utilisation U
      </p>
      <p>R
1
2
3
4
1
2
3
4
going from 0.6 to 0.95 (the results obtained on the 50 runs
with the 50 different tasksets have been averaged). The
figure compares the original CBS and the revised wake-up rule
presented in Section 2.2, with Tis = Pi/R and R = 1..4.
From this first experiment, it is possible to notice that:
1. As expected, the deadline miss probability generally
increases when increasing the system utilisation U
2. The revised rule generally works better (causes less
missed deadlines) than the original CBS
3. Decreasing Tis (increasing R) helps to greatly reduce
the probability of missing deadlines (arriving to nearly
0 even for high system utilisations)
Also notice that setting Tis = Pi/2 already allows to
reduce the probability to miss a deadline to less than 0.5%,
for almost all the values of the utilisation (and using the
revised wake-up rule further improves the real-time
performance without introducing the additional overhead of higher
values of R). Finally, the real-time performance of the “pure
periodic” (non self-suspending) tasks have been checked,
verifying that such tasks do not miss any deadline; this proves
that the temporal protection property is respected.</p>
    </sec>
    <sec id="sec-8">
      <title>4.2 Experiments on a Real System</title>
      <p>After evaluating the proposed approach through simulations,
some experiments have been performed by running real
periodic tasks on Linux 3.15.6, with the SCHED_DEADLINE
scheduling policy. The experiments have been performed on an
machine based on an Intel Xeon W3690 CPU (having 6 cores)
running at 3.47GHz. The Linux kernel used for the
experiments (3.15.6) already includes also the SCHED_DEADLINE
policy which implements the original CBS algorithm, and
has been modified to optionally provide the revised wake-up
rule presented in Section 2.2.</p>
      <p>The real-time tasks used for the experiments are
implemented by an application called rt-app. Using this
application it is possible to run on a real system the same
tasksets used for the previous simulations (of course, in the
real system effects like the kernel latency or some other kind
of overhead can affect the results). Since each run of each
experiment is 60s long, the real experiments require much
more time than the simulation; hence, only some interesting
number of tasks / utilisation configurations have been used.
First of all, rt-app has been used to execute on a single core
the tasksets simulated for N = 6, U = 0.8. The results are
shown in Table 1. From the table, it is possible to notice
that the results obtained in real experiments with small
values of R are comparable with the simulation results, proving
the accuracy of the simulation model and the correctness of
the SCHED_DEADLINE implementation. However, notice that
increasing R (decreasing the server period Tis) the difference
between the results of the real experiments and the results
of the simulations increases (in particular, the number of
missed deadlines in real experiments becomes considerably
larger than in simulations), because of the overhead implied
by small server periods (which is not modelled in the
simulations). In any case, decreasing the server period decreases
the probability of missing a deadline, even in real
experiments (although the performance improvement is smaller
than for simulations).</p>
      <p>Finally, notice that even in real experiments the revised
CBS is able to improve the real-time performance of
selfsuspending tasks respect to the original CBS. A more
detailed analysis showed that the revised CBS “suffers” in real
experiments more than in simulations because in practice
the revised wake up rule tends to reduce the current runtime
to values which are too small, and the kernel immediately
sets it to 0.</p>
      <p>Some additional experiments have been performed on
multicore configurations (using 4 of the 6 cores available on the
Xeon CPU) with SCHED_DEADLINE using global EDF to
schedule the tasks on multiple cores based on their scheduling
deadlines. In general, these experiments confirmed the
initial results for example, Table 2 reports the deadline miss
probabilities for self-suspending tasks measured with 16 tasks
and utilisation U = 3.8 (remember that with 4 cores the
utilisation should be ≤ 4). Again, both reducing the server
period and using the revised wake-up rule allow to reduce
the number of deadlines missed by self suspending tasks;
notice that with R = 2 or R = 4 the revised rule allows to
avoid any missed deadline.</p>
    </sec>
    <sec id="sec-9">
      <title>5. RELATED WORK</title>
      <p>
        The reservation approach is not new [
        <xref ref-type="bibr" rid="ref15 ref19">15, 19</xref>
        ], and has been
previously implemented in various Operating System
kernels, including Linux [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. SCHED_DEADLINE [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] implements
a reservation-based CPU scheduler and is the first example
of this kinds of schedulers that has been accepted in the
mainstream version of a popular and commonly used OS
kernel. Various different modified version of Linux
implementing advanced real-time scheduling algorithms also
exist [
        <xref ref-type="bibr" rid="ref16 ref7 ref8">7, 16, 8</xref>
        ], but none of them has been integrated in the
mainline version of the kernel. Some other works aim at
introducing real-time scheduling algorithms in an existing OS
kernel such as Linux without modifying the kernel source [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
While the original CBS algorithm [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] has been extended
in various ways [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] and many more advanced
reservationbased algorithms have been proposed in literature [
        <xref ref-type="bibr" rid="ref12 ref6">6, 12</xref>
        ],
SCHED_DEADLINE implemented the original algorithm because
of its simplicity. The improvements proposed in this paper
keep the original algorithm simplicity (less than 30 lines of
code have been modified, including comments) while
improving the performance as shown in Section 4, and have
been inspired by practical usage of the CBS
implementation provided by SCHED_DEADLINE. Some work to formally
analyse the schedulability of self-suspending tasks has been
done [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], but it does not consider reservation-based
algorithms.
      </p>
    </sec>
    <sec id="sec-10">
      <title>6. CONCLUSIONS</title>
      <p>This paper described some issues experienced when using
the new SCHED_DEADLINE scheduling policy to schedule real
tasks. In particular, when considering self-suspending task
the strategy used to assign scheduling parameters to tasks
should be changed. It can also be argued that the rule used
by the original CBS algorithm to handle tasks wake-ups
should be revised, in order to properly handle the
wakeups that do not correspond to new job arrivals.
Simulations show that both decreasing the server period and using
the revised wake-up rule improve the real-time performance
of self-suspending tasks, and these results are confirmed by
some experiments with real applications running on a
Linuxbased machine, performed on SCHED_DEADLINE.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Abeni</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Buttazzo</surname>
          </string-name>
          .
          <article-title>Integrating multimedia applications in hard real-time systems</article-title>
          .
          <source>In Proceedings of the IEEE Real-Time Systems Symposium</source>
          , Madrid, Spain,
          <year>December 1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>Abeni</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Buttazzo</surname>
          </string-name>
          .
          <article-title>Stochastic analysis of a reservation-based system</article-title>
          .
          <source>In Proceedings of the 15th International Parallel and Distributed Processing Symposium</source>
          ., San Francisco, California,
          <year>April 2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>L.</given-names>
            <surname>Abeni</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Buttazzo</surname>
          </string-name>
          .
          <article-title>Resource reservation in dynamic real-time systems</article-title>
          .
          <source>Real-Time Systems</source>
          ,
          <volume>27</volume>
          (
          <issue>2</issue>
          ):
          <fpage>123</fpage>
          -
          <lpage>167</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>L.</given-names>
            <surname>Abeni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Palopoli</surname>
          </string-name>
          , G. Lipari, and
          <string-name>
            <given-names>J.</given-names>
            <surname>Walpole</surname>
          </string-name>
          .
          <article-title>Analysis of a reservation-based feedback scheduler</article-title>
          .
          <source>In Proc. of the Real-Time Systems Symposium</source>
          , Austin, Texas,
          <year>November 2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.</given-names>
            <surname>Asberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Nolte</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kato</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Rajkumar</surname>
          </string-name>
          . Exsched:
          <article-title>An external cpu scheduler framework for real-time systems</article-title>
          .
          <source>In Embedded and Real-Time Computing Systems and Applications (RTCSA)</source>
          ,
          <year>2012</year>
          IEEE 18th International Conference on, pages
          <fpage>240</fpage>
          -
          <lpage>249</lpage>
          ,
          <year>Aug 2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Banachowski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Bisson</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Brandt</surname>
          </string-name>
          .
          <article-title>Integrating best-effort scheduling into a real-time system</article-title>
          .
          <source>In RTSS</source>
          , pages
          <fpage>139</fpage>
          -
          <lpage>150</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J.</given-names>
            <surname>Calandrino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Leontyev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Block</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Devi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Anderson. LIT M U SRT :</surname>
          </string-name>
          <article-title>A testbed for empirically comparing real-time multiprocessor schedulers</article-title>
          .
          <source>In Real-Time Systems Symposium</source>
          ,
          <year>2006</year>
          . RTSS '
          <volume>06</volume>
          . 27th IEEE International, pages
          <fpage>111</fpage>
          -
          <lpage>126</lpage>
          ,
          <year>Dec 2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Dellinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Garyali</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.</given-names>
            <surname>Ravindran</surname>
          </string-name>
          .
          <article-title>Chronos linux: a best-effort real-time multiprocessor linux kernel</article-title>
          .
          <source>In Proceedings of the 48th Design Automation Conference</source>
          , pages
          <fpage>474</fpage>
          -
          <lpage>479</lpage>
          . ACM,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>P.</given-names>
            <surname>Emberson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Stafford</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R. I.</given-names>
            <surname>Davis</surname>
          </string-name>
          .
          <article-title>Techniques for the synthesis of multiprocessor tasksets</article-title>
          .
          <source>In Proceedings 1st International Workshop on Analysis Tools</source>
          and
          <article-title>Methodologies for Embedded and Real-time Systems (WATERS</article-title>
          <year>2010</year>
          ), pages
          <fpage>6</fpage>
          -
          <lpage>11</lpage>
          , Brussels, Belgium,
          <year>July 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>D.</given-names>
            <surname>Faggioli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Checconi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Trimarchi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Scordino</surname>
          </string-name>
          .
          <article-title>An EDF scheduling class for the Linux kernel</article-title>
          .
          <source>In Proceedings of the Eleventh Real-Time Linux Workshop</source>
          , Dresden, Germany,
          <year>September 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>G.</given-names>
            <surname>Lipari</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Baruah</surname>
          </string-name>
          .
          <article-title>Greedy reclaimation of unused bandwidth in constant bandwidth servers</article-title>
          .
          <source>In IEEE Proceedings of the 12th Euromicro Conference on Real-Time Systems</source>
          , Stokholm, Sweden,
          <year>June 2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>C.</given-names>
            <surname>Lin</surname>
          </string-name>
          and
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Brandt</surname>
          </string-name>
          .
          <article-title>Improving soft real-time performance through better slack reclaiming</article-title>
          .
          <source>In RTSS '05: Proceedings of the 26th IEEE International Real-Time Systems Symposium</source>
          , pages
          <fpage>410</fpage>
          -
          <lpage>421</lpage>
          , Washington, DC, USA,
          <year>2005</year>
          . IEEE Computer Society.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>C.</given-names>
            <surname>Liu</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Anderson</surname>
          </string-name>
          .
          <article-title>Task scheduling with self-suspensions in soft real-time multiprocessor systems</article-title>
          .
          <source>In Real-Time Systems Symposium</source>
          ,
          <year>2009</year>
          ,
          <string-name>
            <surname>RTSS</surname>
          </string-name>
          <year>2009</year>
          .
          <source>30th IEEE</source>
          , pages
          <fpage>425</fpage>
          -
          <lpage>436</lpage>
          ,
          <year>Dec 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>C. L.</given-names>
            <surname>Liu</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Layland</surname>
          </string-name>
          .
          <article-title>Scheduling alghorithms for multiprogramming in a hard real-time environment</article-title>
          .
          <source>Journal of the ACM</source>
          ,
          <volume>20</volume>
          (
          <issue>1</issue>
          ),
          <year>1973</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>C. W.</given-names>
            <surname>Mercer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Savage</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Tokuda</surname>
          </string-name>
          .
          <article-title>Processor capacity reserves: Operating systems support for multimedia applications</article-title>
          .
          <source>In Proceedings of the IEEE International Conference on Multimedia Computing and Systems</source>
          , May
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>D.</given-names>
            <surname>Niehaus</surname>
          </string-name>
          and
          <string-name>
            <given-names>N.</given-names>
            <surname>Watkins</surname>
          </string-name>
          .
          <article-title>A flexible scheduling framework supporting multiple programming models with arbitrary semantics in linux</article-title>
          .
          <source>In Proceedings of the Eleventh Real-Time Linux Workshop (RTLWS)</source>
          , Dresden,
          <year>September 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>S.</given-names>
            <surname>Oikawa</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Rajkumar</surname>
          </string-name>
          . Linux/RK:
          <article-title>A portable resource kernel in Linux</article-title>
          .
          <source>In Proceedings of the IEEE Real-Time Systems Symposium Work-In-Progress</source>
          , Madrid,
          <year>December 1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>L.</given-names>
            <surname>Palopoli</surname>
          </string-name>
          , G. Lipari,
          <string-name>
            <given-names>G.</given-names>
            <surname>Lamastra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Abeni</surname>
          </string-name>
          , G. Bolognini, and
          <string-name>
            <given-names>P.</given-names>
            <surname>Ancilotti</surname>
          </string-name>
          .
          <article-title>An object-oriented tool for simulating distributed real-time control systems</article-title>
          .
          <source>Software: Practice and Experience</source>
          ,
          <volume>32</volume>
          (
          <issue>9</issue>
          ):
          <fpage>907</fpage>
          -
          <lpage>932</lpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>R.</given-names>
            <surname>Rajkumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Juvva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Molano</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Oikawa</surname>
          </string-name>
          .
          <article-title>Resource kernels: A resource-centric approach to real-time and multimedia systems</article-title>
          .
          <source>In Proceedings of the SPIE/ACM Conference on Multimedia Computing and Networking</source>
          ,
          <year>January 1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>J.</given-names>
            <surname>Strosnider</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lehoczky</surname>
          </string-name>
          , and
          <string-name>
            <surname>L. Sha.</surname>
          </string-name>
          <article-title>The deferrable server algorithm for enhanced aperiodic responsiveness in hard real-time environments</article-title>
          . Computers, IEEE Transactions on,
          <volume>44</volume>
          (
          <issue>1</issue>
          ):
          <fpage>73</fpage>
          -
          <lpage>91</lpage>
          ,
          <year>Jan 1995</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>