Schedulability Bound of Weighted Round Robin Schedulers for
Hard Real-Time Systems
Jianjia Wu, Jyh-Charn Liu, and Wei Zhao
Department of Computer Science,
Texas A&M University
{jianjiaw, liu, zhao}@cs.tamu.edu
Abstract
We derive a parameterized, closed-formed schedulability bound for weighted round robin schedulers
in hard real-time computing systems. The schedulability bound uses several parameters to represent
important system behaviors: (1) Number of tasks; (2) Normalized deadline that measures the tightness of
task deadlines; (3) Tasks set workload burst-ness; (4) Overhead ratio, which measures the portion of
overhead time consumed in round robin operations; (5) Normalized token rotation frequency, that
measures the number of token rotations in a time interval of the shortest relative deadline.
Our work follows the network calculus representation framework and is based on a generalized
workload and service approximation models. We derive a closed form expression of the utilization bound,
so that one can analyze the impact of particular system parameters on the schedulability bound and
schedulability bounds for specific system configurations can be easily obtained by simply plugging in
proper parameters.
1
TABLE OF CONTENT
1. INTRODUCTION ...................................................................................................................................................1
2. SYSTEM MODEL...................................................................................................................................................3
2.1 TASK, TASK SET, WORKLOAD, AND SERVICE FUNCTION .....................................................................................3
2.2 TASK MODEL .......................................................................................................................................................5
2.2.1 Workload Constraint Function....................................................................................................................5
2.2.2 S-shaped Workload Constraint Functions ..................................................................................................5
2.2.3 Parameters of Task Set................................................................................................................................6
2.3 SCHEDULER MODEL.............................................................................................................................................9
2.3.1 Service Constraint Function........................................................................................................................9
2.3.2. Weighted Round Robin Scheduler............................................................................................................10
2.3.3. Service Constraint Function of WRR Scheduler ......................................................................................11
2.3.3 Parameters of Weight Round Robin Schedulers .......................................................................................12
3 SCHEDULABILITY BOUND...............................................................................................................................13
3.1 SCHEDULABILITY BOUND ..................................................................................................................................13
3.2 A LOWER BOUND OF SCHEDULABILITY BOUND ................................................................................................14
4 SCHEDULABILITY BOUND OF WEIGHTED ROUND ROBIN SCHEDULERS ......................................16
4.1 PARAMETERIZED SCHEDULABILITY BOUND OF WRR SCHEDULER ....................................................................17
4.2 PARAMETER SENSITIVITY ANALYSIS OF THE WRR SCHEDULABILITY BOUND ..................................................20
4.3 OPTIMAL TTRT SELECTION TO MAXIMIZE SCHEDULABILITY BOUND ...............................................................22
5. COMPARISON WITH EXISTING RESULTS..................................................................................................24
5.1 COMPARISON WITH STATIC PRIORITY SCHEDULERS ..........................................................................................24
5.2 COMPARISON WITH TIMED TOKEN PROTOCOL ...................................................................................................27
6. FINAL REMARKS ...............................................................................................................................................28
REFERENCES ..........................................................................................................................................................29
APPENDIX ................................................................................................................................................................31
2
1. INTRODUCTION
Weighted round robin (WRR) scheduling discipline has been implemented in a broad range of mission
critical computing and communication systems. In a WRR scheduler, tasks are performed in a cyclic
order, in which the time a task can execute within each round is proportional to the weight assigned to it.
Weighted round robin schedulers have two major advantages:
•
Ability to improve the system robustness, given their guarantee of a minimum service rate for
each task. For weighted round robin schedulers, the maximum amount of service every task
can receive in each round is upper-bounded by its allocation. As such, no task can consume
more service than what has been assigned.
•
Ability for implementation in a distributed fashion. A WRR scheduler can be easily realized in
a distributed environment through a logic ring like the timed token protocol [2]. By passing a
token along the ring, nodes can access resource in turn based on their weight assignments.
It has been proven in [21] that with proper weight assignment, weighted round robin schedulers can
provide deadline guarantees for real-time computing systems. Yet a major challenge is how to devise a
low complexity schedulability test, which would guarantee the deadline requirements, achieve high level
of resource utilization, and is applicable to a broad range of system configurations. According to [22], a
schedulability test can be direct or indirect. A direct schedulability test explicitly calculates the precise
worst-case delay of each task in order to determine the permissibility of a new task. Despite its accuracy,
this type of test has high run-time cost in calculating the worst case task delays, and therefore may not be
suitable for on-line admission control. In contrast, an indirect schedulability test would use one or more
system indicators to determine the schedulability of a new task without computing the worst case task
delays directly. The utilization based schedulability test is the most common indirect schedulability test,
in which a new task can be admitted only if the total system utilization (as the system indicator) is lower
than a pre-determined bound. Utilization bound based schedulability test is highly desirable for large,
1
complex systems, because of its extreme efficiency and the ability to provide a safe operation margin by
setting the system utilization bound to a value lower than the proven utilization bound [22].
Despite its extreme simplicity in on-line admission control, limited results have been obtained on
schedulability bound of WRR schedulers. Most existing work about WRR schedulers has focused on
maximizing the resource utilization through clever weight assignments, without considering the
complexity and overhead of the schedulability test algorithms. In many large-scale systems, it is desirable
to trade some level of resource utilization for a simple and fast schedulability test. To achieve this goal,
this paper proposes to employ the general framework developed in [22] to analyze the schedulability
bound of the weighted round robin schedulers. We focus on a special weight assignment scheme in which
task weights are assigned in proportion to their resource demand rates. This weight assignment scheme
matches many resource allocation requirements in practice, i.e. assigning larger weights to users with
greater resource consumption rates.
We derive a closed-form expression for the schedulability bound of WRR schedulers with normalized
weight assignments. The schedulability bound is parameterized for number of tasks, the normalized
deadline, which measures the tightness of deadline assignment, the tasks set workload burst-ness, the
overhead ratio, which measures the portion of overhead time consumed in round robin operations per
round, and the normalized token rotation frequency, which measures the number of token rotations in a
time interval of the shortest relative deadline of the tasks.
Unlike the relatively developed knowledge body on the schedulability bounds of static priority
schedulers [1], [4], [5], [6], [7], [12], [15], [16], [17], [18], [19], [22], earliest deadline first schedulers
[17], timed token ring schedulers [2], [3], [11], [24], [25], [26], [27], [28], [29], [30], and their variations,
no known bounds could be found for the weighted round robin schedulers in the literature. This paper
presents the first systematic results of schedulability bounds for weighted round robin schedulers, derived
using a formal modeling and optimization technique developed for general real-time systems. Its closedform expression allows one to easily analyze the impact of system parameters over the schedulability
2
bounds, and to efficiently and effectively find the schedulability bounds for specific system
configurations through simple substitution of parameter values. The highly versatile modeling and
optimization method presented in this paper can be tailored for analysis of other types of real-time
systems.
The rest of the paper is organized as follows. Section 2 introduces our general system model. Section 3
discusses the schedulability bound analysis methodologies and derives a general bound result for arbitrary
schedulers. In Section 4, a closed-form schedulability bound is derived and analyzed for WRR scheduler.
Detailed comparisons of the newly derived bound with the known results of other schedulers are provided
in Section 5, followed by conclusions in Section 6.
2. SYSTEM MODEL
The closed-form expression of the schedulability bound for WRR based real-time schedulers is derived
by applying a constrained optimization technique to the workload-service models proposed in [22]. To
make this paper self contained, we introduce the generalized system model in this section. The details on
derivation of the schedulability bound for WRR schedulers using the general model will be given in the
next section.
2.1 Task, Task Set, Workload, and Service Function
This paper considers single processor systems. We use Γ = {T1 , T2 , ..., Tn } to denote a task set, where
Ti is the ith task. When the context is clear, we may omit index i in the subsequent discussions. Each task
is composed of a sequence of jobs. The worst-case execution time of a job is called the job size, which is
measured in second. A job can start its execution after its release time, tr , and must be finished by its
absolute deadline td = tr + D where D is called relative deadline. For a job, the time elapsed from the
release time tr to the completion time t f is called the delay of the job, and the worst-case (i.e., largest)
3
delay of all jobs in a task is denoted by d * . Within a task, the jobs have the same relative deadline, but
may not necessarily be the same size. Jobs within a task are executed in a first come, first served order.
To characterize the resource demand of task T analytically, we define f (t ) , the workload function for
T , as follows,
f (t ) = the summation of the sizes of all the jobs from T in [0, t ].
(2.1)
Similarly, to characterize the actual processor time received by task T, we define g (t ) , the service
function for T , as follows,
g (t ) = the total execution time rendered to jobs of task T during [0, t ].
(2.2)
Based on the definitions of d * , f (t ) and g (t ) , the following worst case delay formula can be easily
derived [7]:
d * = supt ≥0 ( inf (τ | f (t ) ≤ g (t + τ ) ) ) .
(2.3)
From [8] and [22], we know that in (2.3) inf (τ | f (t ) ≤ g (t + τ ) ) is the delay of the jobs arriving at time t
and thus d * is the worst case delay of all the jobs from task T .
A basic function of the schedulability test algorithm is to determine whether the following inequality
holds:
d* ≤ D .
(2.4)
One may want to use (2.3) to calculate d * and then compare the result with D to test the
schedulability. However, this method may not be suitable for online operation because the exact forms of
f (t ) and g (t ) may not be available when schedulability test is made. Furthermore, even if f (t ) and g (t )
4
are available, they are often too cumbersome to handle. A practical solution is using some alternative
forms of f (t ) and g (t ) that can be obtained during schedulability test.
2.2 Task Model
2.2.1 Workload Constraint Function
Much work has been performed to find alternatives to f (t ) in order to model task workload for delay
analysis. For example, a typical alternative is the workload constraint function F ( I ) introduced in [13]
and [14] (under the name of workload curve). F ( I ) is said to be a workload constraint function for task T
if for any 0 ≤ I ≤ t ,
f (t ) − f (t − I ) ≤ F ( I ) .
(2.5)
It is obvious that, given any F that satisfies (2.5), F ( I ) is an upper bound of total size of jobs that can
be released in any time window [t − I , t ] . We use I in (2.5) because F is defined on the domain of time
intervals, while f (t ) is defined on the domain of time. Note that (2.5) defines a group of functions, and
for analysis convenience, we will focus on those which are non-decreasing and satisfy F (0) = 0 .
2.2.2 S-shaped Workload Constraint Functions
In this paper, we consider a special class of F, called s-shaped workload constraint function. As its
name suggests, an s-shaped workload constraint function consists of segmented pieces, and resembles a
staircase. The values of an s-shaped workload constraint function increase only at border points of
segments. We assume that the segment length S is fixed and the increments may not be identical for the
first L segments where L is a parameter in the function.
5
F (I )
L=4
C
C
C4
C3
C1
C2
2S
S
3S
4S
5S
I
Figure 1. An Example S-Shaped Workload Constraint Function
Formally, an s-shaped workload constraint function can be expressed as follows:
F (I ) =
⎧
⎪
⎪⎪
⎨
⎪
⎪
⎪⎩
∑
∑
h
j =1
L
Cj
C j + (a − L)C
j =1
h ≤ L
h>L
(2.6)
,
where h = ⎢⎡ I / S ⎥⎤ , C j is the increment at the beginning of the jth segment, and C is the constant increment
after the Lth segment. Figure 1 shows an example of the s-shaped workload constraint function. When
L = 1 , an s-shaped constraint function reduces to the classical periodic task model F ( I ) = ⎡⎢ I / P ⎤⎥ C . In this
paper, we assume
C1 ≥ C 2 ≥ L ≥ C L ≥ C.
(2.7)
2.2.3 Parameters of Task Set
To characterize the task set in the sense of its real-time demand, we introduce several parameters.
These parameters will be used in the derived schedulability result.
2.2.3.1. Workload Rate
6
Recall that the goal of this paper is to derive a bound based schedulability test, such as the utilization
based method. To do so, we need to generalize the classical utilization defined for periodic tasks to
accommodate other non-periodic tasks using the workload constraint function defined above.
Generally speaking, utilization is the resource consumption rate in a measuring time window. For
periodic systems, task period is typically used as the length of the measuring window. This approach is
not applicable to non-periodic tasks since one may not have a well defined "period". As such, in [1] and
[4], the authors proposed to use the task relative deadline as the length of the measuring window. While
this choice is simple and convenient for some cases, we find that it is too restrictive for the design of a
versatile utilization bound analysis system. To relax the constraints, we propose to define the length of the
measuring window as a linear scale of the relative deadline. That is, the length of the measuring window
will be expressed as θ D , where θ > 0 is called the scaling parameter and D is the relative deadline of
the task.
To avoid confusion with notations from other literatures, we refer to this generalized utilization as the
scaled workload rate, and formally express it as follows:
Wi (θ ) =
Fi (θ Di )
,
θ Di
(2.8)
and the task set workload rate as follows:
W (θ , Γ) = ∑ i =1Wi (θ ).
n
(2.9)
When the context of discussion is clear, the term “scaled” may be omitted. Since Fi (θ Di ) is an upper
bound of the size of jobs that can be released in any time window of length θ Di , W (θ , Γ) can be treated
as an upper bound of the job releasing rate averaged in a window of length θ Di . Introducing θ into the
modeling process parameterizes the utilization measurement. For example, when θ = 1 , (2.9) reduces to
7
the definition provided in [1] and [4]. This parameterized measurement of utilization enables flexible
representation of different scheduling and workload scenarios, and more importantly, leads to a uniform
analysis system of schedulability bounds.
2.2.3.2. Normalized Deadline
To capture the tightness of the task deadline requirements of different systems, we define the
normalized deadline ki for Ti as follows:
ki = Di / Si
,
(2.10)
where Di is the relative deadline of task Ti and Si is the segment length in the s-shaped workload
constraint function defined in (2.6). We follow the convention that for i = 1, 2, ..., n
ki
= k,
(2.11)
k can be viewed as the deadline using S as the measurement unit, and it characterizes tightness of the
deadline requirements. The smaller the k, the more difficult it is to schedule the task.
2.2.3.3. Burst-ness
To characterize the burst-ness of different tasks we introduce burst-ness parameter μi for Ti as:
μi =
F ( S i ) / Si
F ( ⎡ k ⎤ Si ) /( ⎡ k ⎤ Si )
,
(2.12)
and the burst-ness for the task set as:
μ = max i =1, 2, ..., n ( μi ) .
(2.13)
By (2.7), one can notice that
0 ≤ μ ≤1
.
(2.14)
8
μ is ratio between the workload rate in a time window Si , and that in ⎡ k ⎤ Si . Larger μ means more
bursty workload.
2.3 Scheduler Model
Recall that g defined in (2.2) characterizes the amount of services a task may receive via a WRR
scheduler. That is, g reflects the behavior of the scheduler. However, we cannot practically use the form
of g as defined in (2.2) which was pointed out in Section 2.1. Thus, in this section, we will start modeling
the scheduler by considering the alternatives of g. We will then formally define the WRR scheduler and
present an analytical model for it.
2.3.1 Service Constraint Function
A common alternative to g (t ) is the generalized service constraint introduced in [8], [9], and [10]
(under the name of service curve). G ( I ) is said to be a generalized service constraint function if for any
t ≥ 0 , there exists I ≤ t that preserves the property
g (t ) ≥ f (t − I ) + G ( I ) .
(2.15)
Typically, we assume that G ( I ) is non-decreasing and G (0) ≥ 0 . (2.15) means that for any t , we can
find I, where 0 ≤ I ≤ t , such that 1) all the jobs released in [0, t − I ] have been served, and 2) for jobs
released in [ t − I , t], at least G(I) amount of jobs have been served, as illustrated in Figure 2.
at least G(I ) of jobs released
and served in this interval
jobs released and served in
this interval
0
t-I
t
Figure 2: Components in The Generalized Service Constraint Function
9
2.3.2. Weighted Round Robin Scheduler
Under the WRR scheduling discipline, task services are time-multiplexed in a cyclic, round robin
fashion. A token is rotated in the cycle and a task can execute only if has the token. After receiving the
token, task Ti can run for up to Hi time unit where Hi is the time allocated to a task i. Typically, Hi is
calculated as
H i = Oi ⋅ (TTRT − τ ) ,
(2-16)
where Oi , 0 ≤ Oi ≤ 1 , is the weight of task Ti , and the TTRT is the target token rotation time, which is
the desired time to complete one round of token rotation, and τ is the time overhead for token rotation
and other round robin operations in each round, (e.g. the context switching cost in a single processor
system or the propagation delay in a distributed system). Generally speaking, τ can be expressed as
τ = n ⋅τ 0 ,
(2-17)
where n is the number of tasks in the system and τ 0 is a overhead constant which models the cost of
context switch or/and token propagation delay.
To use the WRR scheduling discipline to schedule hard real-time computing tasks, weights Oi must be
properly allocated. In this paper, we will show that an effective weight assignment scheme is based on the
normalized weight assignments:
Oi =
Wi (1)
,
W (1, Γ)
where Wi (1) = Fi ( Di ) / Di is the workload of task Ti and W (1, Γ) =
(2-18)
∑
n
i =1
Wi (1) is the workload rate of
the task set defined in (2.9). Intuitively, the weights of the tasks are assigned in proportion to their
10
workload rates. This weight assignment scheme matches many resource allocation requirements in
practice, i.e. assigning larger weights to users having greater resource consumption rates.
2.3.3. Service Constraint Function of WRR Scheduler
For the WRR scheduler, we have the following result on its service constraint function.
Theorem 1. For WRR schedulers, a service constraint function for task Ti , is given by
I
⎢
⎥
Gi ( I ) = ⎢
n
⎥ Hi .
⎢⎣ nτ 0 + ∑ j =1 H j ⎥⎦
(2-19)
Proof: See Appendix.
G( I )
I
Figure 3. An Example Service Constraint Function of Weighted Round Robin Scheduler
We can make the following observation over (2-19):
•
The service constraint functions are of periodic shapes, i.e. the values of the service constraint
function increase only at multiples of the period nτ 0 +
∑
n
j =1
H j at the amount of H i for task
Ti . This feature can be attributed to the fact that a WRR scheduler grants services to each task Ti
up to H i amount of time in each round, whose length is equal to τ +
∑
n
j =1
H j . An example
service constraint function is given in Figure 3.
11
•
The value of the service constraint function is a decreasing function of overhead constant τ 0 . But
an increasing function of assigned weight Hi. Both are intuitive since the lower the overhead
and/or the bigger the weight, the more the service time for the task.
•
When the overhead constant τ 0 is zero and TTRT → 0 , the scheduler becomes the well-known
Generalized Process Sharing (GPS) system and the service constraint function reduces to
Gi ( I ) = Oi ⋅ I where Oi is the weight of task Ti .
2.3.3 Parameters of Weight Round Robin Schedulers
To derive schedulability bounds that can achieve high system resource utilization and is easily
applicable to various system settings, it is important to select proper system parameters to capture the
dynamics of the system configurations. We will introduce two parameters, i.e. overhead ratio and
normalized token rotation frequency for this purpose.
To measure the portion of time consumed in round robin operations relative to the length of rotation,
we define the overhead ratio α as follows:
α=
τ0
TTRT
,
(2.20)
where τ 0 is the overhead constant defined in (2-17).
To capture the effect of token rotation speed on the schedulability bound, we define the second system
parameter normalized token rotation frequency as follows:
,
(2.21)
Dmin = min( Di ) ,
(2.22)
γ = ⎢⎣ Dmin / TTRT ⎥⎦
where
12
and we assume that
Dmin ≥ TTRT
.
(2.23)
γ is the number of rounds the token rotates within a time interval of length Dmin. The larger the γ, the
faster the token rotates.
3 SCHEDULABILITY BOUND
With workload and service constraint functions defined in (2.5) and (2.15) as chosen alternatives of
f (t ) and g (t ) for modeling task workload and scheduler service, a general result on the schedulability test
using F ( I ) and G ( I ) is derived in [22], which can be stated as in the following theorem.
Theorem 2: A task is schedulable if for any I ≥ 0
F ( I ) ≤ G ( I + D) .
(3.1)
where D is the relative deadline of the task.
Though one can use (3.1) for each task to decide its schedulability test, it may be time consuming,
since (3.1) needs to be checked for all I ≥ 0 . An alternative is the utilization based schedulability test.
3.1 Schedulability Bound
For a given system, we say that W ∗ (θ ) is a schedulability bound if an arbitrary task set Γ is schedulable
when the following condition holds:
W (θ , Γ) < W ∗ (θ ) .
(3.2)
13
The challenge is how to derive W * (θ ) for a broad range of workload patterns and scheduling
disciplines. Let the space of all task sets be denoted as Ω, i.e., Ω = {Γ}. Ω can be partitioned into two
subsets, Ωs and Ωns, where
Ωs = {Γ | Γ is schedulable}
(3.3)
Ωns = {Γ | Γ is not schedulable}.
(3.4)
and
W * (θ ) is a lower bound of the workload rate of these task sets that belong to Ωns. That is
W * (θ ) ≤ inf Γ∈Ωns (W (θ , Γ) ) .
(3.5)
Figure 4 illustrates this concept.
W (θ , Γ)
Ω ns
W * (θ )
Ωs
Figure 4. Illustration of Schedulability Bound
3.2 A Lower Bound of Schedulability Bound
In practice, it is often very difficult to obtain an exact expression of Ωns. Instead, it may be desirable to
use a substitution of Ωns in (3.5) for schedulability analysis. Specifically, we want to derive the
schedulability bound using the following inequity:
14
W * (θ ) ≤ inf Γ∈Ω* (W (θ , Γ) ) .
(3.6)
In order to maintain the correctness of the schedulability bound, Ω* must satisfy the following constraint:
Ω ns ⊆ Ω* .
(3.7)
That is, Ω* must contain all elements in Ωns so that the derived bound will be no higher than that obtained
with original Ωns. Figure 5 illustrates this concept.
W * (θ )
Ω ns
Ω*
W (θ , Γ)
Ωs
Figure 5. Relationship Between Ωns and Ω*.
If the Ω* is selected properly, the bound obtained with the substitution could be close to the tight
schedulability bound obtained with Ωns, if not the same. An interesting question is how to select Ω* that
can work for different type of tasks and schedulers. Clearly, we do not want the expression of Ω* to
depend on f and g, since they are difficult to obtain and handle. Instead, it is desirable to define Ω* using
F and G. It presents an interesting and challenging task to perform a full investigation of the options of Ω*
and their effects on the resulting schedulability bound. This investigation is yet to be seen. Nevertheless,
we notice that the following definition works well for WRR schedulers:
Ω* = {Γ | ∃Ti ∈ Γ such that Fi ( I ) > Gi ( I + D )} .
(3.8)
15
That is, Ω* is the collection of task set which has at least one task not satisfying (3.1). The following
Theorem proves that substituting Ωns with Ω* is feasible.
Theorem 3. Given a collection of task set Ω, a schedulability bound with scaling parameter θ is given
by:
W * (θ ) = inf Γ∈Ω* (W (θ , Γ) ) .
(3.9)
where Ω* and W (θ , Γ) are defined in (3.8) and (2.9) respectively.
Proof: By a close comparison of (3.9) and (3.5), we know that we just need to prove the following:
Ω ns ⊆ Ω* .
(3.10)
Assume (3.10) does not hold, then there must exist a non-schedulable task set Γ ' such that Γ ' ∉ Ω* .
However, by (3.8) we know that for all i, i=1, 2, ..., n, Fi ( I ) ≤ Gi ( I + D) . By Theorem 2, we know that
Γ ' is schedulable. This contradicts the fact that Γ ' is non-schedulable. Then the Theorem follows.
Q.E.D.
In the following section, we will derive W ∗ for weighted round robin schedulers using Theorem 3.
4 SCHEDULABILITY BOUND OF WEIGHTED ROUND ROBIN SCHEDULERS
In this section, we will analyze the schedulability bound of WRR scheduler using the general system
model and methodology introduced in the previous sections.
16
4.1 Parameterized Schedulability Bound of WRR Scheduler
Based on the task parameters defined in (2.10) and (2.13), the scheduler parameters defined in (2.20)
and (2.21), we derive our schedulability bound by substituting the service constraint functions of WRR
scheduler derived in (2-19) into Theorem 3 and solving the resulting optimization problem. The result is
stated formally in the next Theorem
Theorem 4. A lower bound of schedulability bound with scaling parameter θ = ⎡ k ⎤ / k for weighted
round robin scheduler with normalized weight assignment, and s-shaped tasks is given by
W * ( ⎡k ⎤ / k ) =
1
1/ γ + 1
⋅ (1 − nα ) ⋅
Proof: See Appendix.
1
μ
⋅ min (1, k ) .
(4-1)
Q.E.D.
(4-1) is a parameterized bound result. By substituting specific values of these parameters into (4-1),
one can obtain the different schedulability bound results. To illustrate how the bound result can be used in
practical systems, we introduce the following two examples.
Example 1: Consider a simple real-time robot controller who is responsible for the routing control of
three data sampling robots, A, B, and C. The three robots are driving at different speeds and the controller
communicates with the robot at a different frequency, i.e. once every 2.0, 5.0, and 20.0 seconds, for A, B,
and C, respectively. For the three robots, the controller takes 0.25, 0.30, and 0.65 seconds to finish the
route selection and communication. The route selection and communication must be finished within 4.0,
3.0, and 20.0 seconds for A, B, and C to avoid robot damages. The controller uses a WRR scheduling
discipline with target token rotation time of 2.0 seconds per round. There is a cost of 0.002 seconds per
context switching (changing the robot to be served). The weights for robots are assigned in normalized
fashion using (2-18). Now we need to decide whether the controller can finish all the routing tasks within
their deadlines.
17
From the above description, we know there are three periodic tasks Γ = {T1 , T2 , T3 } where
Fi ( I ) = ⎡⎢ I / Pi ⎤⎥ Ci
(4-2)
C1 = 0.25 P1 = 4.0
D1 = 4.0
C2 = 0.30 P2 = 5.0 D2 = 3.0
C3 = 0.65 P3 = 20.0 D3 = 20.0.
(4-3)
and
For this set of tasks, by (2.20), (2.21), (2.10), and (2.12), we have α = 0.001 , γ = 2 , k = 1 ,
and μ = 1 . To decide whether the task set is schedulable or not, we must calculate the total system
workload rate as follows:
3
W (1, Γ) = ∑
i =1
Fi ( Di ) C1 C2 C3 0.25 0.3 0.65
= +
+
=
+
+
= 0.1505.
Di
P1 P2 P3
4.0 5.0 20.0
(4-4)
By substituting n = 3 , α = 0.001 , γ = 2 , k = 1 , and μ = 1 into (4-1), we have a schedulability bound
of 0.66. Since 0.1505<0.66, we conclude that task set is schedulable.
Example 2: Now we consider a more complex scenario of the above robot controller. The controller
needs to send routing commands to robot A, B, C every 4.0, 5.0, and 20.0 seconds. The first time the
controller communicates with the robots takes longer and requires 1.0, 1.2, 1.3 seconds for A, B, and C,
respectively. After the first time, the time reduces to 0.5, 0.6, and 0.65 seconds. This time, the routing and
communication for robot A, B, C must be finished within 8.0, 10.0, and 40.0 seconds (including the first
time). Again, the controller uses a WRR discipline with normalized weight assignments and TTRT=2,
τ = 0.002 . We need to decide whether the controller can serve the three robots while guaranteeing their
deadlines.
18
From the above description, we know that we can model the communication and routing selection with
three s-shaped tasks: Γ = {T1 , T2 , T3 } where
⎧
⎪
Fi ( I ) = ⎪⎨
⎪
⎪
⎩
Ci1
I ≤ Pi
1
i
I > Pi
C + ( ⎡⎢ I / Pi ⎤⎥ − 1) C
(4.5)
,
and
C11 = 1.0 C12 = 0.5 P1 = 4.0
D1 = 8.0
1
2
C2 = 1.2 C2 = 0.6 P2 = 5.0 D2 = 10.0
C31 = 1.3 C32 = 0.65 P3 = 20.0 D3 = 40.0.
(4-6)
To decide whether the task set is schedulable or not, we should calculate the total system workload rate
as follows:
3
W (1, Γ) = ∑
i =1
Fi ( Di ) C1 C2 C3 1.0 1.2
1.3
=
+
+
=
+
+
= 0.17.
Di
D1 D2 D3 8.0 10.0 40.0
(4-7)
For this set of tasks, by (2.20), (2.21), (2.10), and (2.12), we have α = 0.01 , γ = 4 , k = 2 ,
and μ = 1.5 By substituting n = 3 , α = 0.01 , γ = 4 , k = 2 , and μ = 1.5 into (4-1), we obtain a
schedulability bound of 0.53. Since 0.53 >0.17, we conclude that the task set is schedulable.
The above two examples illustrate how to use the newly derived schedulability bound for
schedulability analysis. In the next section, we will discuss in detail how the different parameters affect
the schedulability bound as well as a comparison with the well known schedulability bound of the rate
monotonic scheduler.
19
4.2 Parameter Sensitivity Analysis of the WRR Schedulability Bound
By (4-1), we can make the following observations on the sensitivity of the schedulability bound on the
different system parameters:
•
For given values of n, k, μ, and α, the schedulability bound increases with the token rotation
frequency. Thus, the faster the token rotates, the better chance a task set can be scheduled. Figure
6 illustrates this trend for the case of α = 0.
•
For given values of n, k, μ, and α, the schedulability bound decreases with the task set burst-ness
μ . Increasing of μ implies a more bursty workload, which tends to be more difficult to schedule
than less bursty ones. The schedulability bound is maximized when μ =1, which corresponds to
periodic tasks.
•
For given values of n, k , γ , and μ , the schedulability bound increases when overhead ratio
α decreases. The schedulability bound is maximized when α =0, which is an ideal case and
means that there is no overhead in round robin operations.
•
For given values of k , γ , μ , and α , the schedulability bound decreases when the number of
tasks in the system increase and approaches zero when n → 1/ α which means all processor time
will be devoted to round robin operations.
•
For periodic tasks with relative deadlines equal to periods, i.e., Di=Pi, and token rotation
frequency γ = 2 , (token rotates twice per Dmin interval), the schedulability bound is 67%. When
the normalized deadline increases from 1.0 to 10.0, the schedulability bound remains at 67%.
This is illustrated as a serial of points in Figure 7. Note that this does not imply that k has no
effect on the schedulability test, since the workload rate is measured differently.
•
For periodic tasks with relative deadlines equal to their period (Di=Pi), and token rotation
frequency γ = 1 , (token rotates at least once per Dmin interval), the schedulability bound is 50%.
This is highlighted on Figure 8 as a point.
20
Figure 6. Schedulability Bound With k = 1
Figure 7. Schedulability Bound With γ = 2
21
Schedulability Bound
1
50.0%
0.8
0.6
0.4
2
10
0.2
1
0
0
10
0.5
k
1
μ = 1, α = 0
γ
0
1.5
10
Figure 8. Schedulability Bound With μ = 1
4.3 Optimal TTRT Selection to Maximize Schedulability Bound
In a WRR system, for a given task set, parameters n, k and μ are fixed. In order achieve a higher
schedulability bound, one can adjust TTRT. By (2.20) and (2.21), we know that setting larger TTRT may
reduce operation overhead ratio but at the same time leading to lower rotation frequency. Thus, TTRT
should be adjusted in a way that balances the operation overhead ratio and the token rotation frequency.
The following theorem gives the value of TTRT that maximizes the schedulability bound.
Theorem 4. The schedulability bound of a WRR scheduler, for a given set of tasks, is maximized when
the value of TTRT is selected as follows:
TTRT = Dmin / γ * ,
(4-8)
where
22
⎧
⎪1
⎪
⎪
⎪
γ * = ⎨ ⎢⎣ Dmin / nτ 0 + 1 ⎥⎦ − 1
⎪
⎪
⎪
⎪ ⎡⎢ Dmin / nτ 0 + 1 ⎤⎥ − 1
⎩
if nτ 0 / Dmin ≥ 1/ 3
if nτ 0 / Dmin < 1/ 3 and
(
) (
)
Z ⎢⎣ Dmin / nτ 0 + 1 ⎥⎦ − 1 <Z ⎡⎢ Dmin / nτ 0 + 1 ⎤⎥ − 1
,
(4-9)
otherwise
and
Z ( x) =
⎛
⎞
nτ
1
⋅ ⎜1 − 0 x ⎟ .
1/ x + 1 ⎝ Dmin ⎠
(4-10)
When the TTRT takes the optimal value, the schedulability bound is given by
W * ( ⎡k ⎤ / k ) =
⎛
⎞ 1
nτ
1
⋅ ⎜1 − 0 γ * ⎟ ⋅ ⋅ min (1, k ) .
1/ γ * +1 ⎝ Dmin
⎠ μ
Proof: See Appendix.
(4-11)
Q.E.D.
By a careful observation of Theorem 4, we notice that the optimal TTRT value that maximizes the
schedulability bound only depends on ratio nτ 0 / Dmin . This ratio is the percentage of time consumed in
round robin operations with a window of length Dmin . When ratio nτ 0 / Dmin ≥ 1/ 3 , the optimal TTRT
equals to Dmin
and when
Dmin
⎢ Dmin / nτ 0 + 1 ⎥ − 1
⎣
⎦
or
nτ 0 / Dmin < 1/ 3 , the optimal TTRT value would be either
Dmin
⎡
⎤
⎢ Dmin / nτ 0 + 1 ⎥ − 1
.
Figure 9 plots the trend of the maximum schedulability bound of WRR with the optimal TTRT
selection for the case of k = 1 and μ = 1 . It is clear from the Figure 9 that, when the optimal value of
TTRT is used, the schedulability bound of WRR is a monotonic decreasing function of nτ 0 / Dmin . The
23
rate of decrease is low for small values of nτ 0 / Dmin , say, less than 0.01, and the rate gradually increases
when nτ 0 / Dmin becomes larger. When nτ 0 / Dmin approaches 1.0, the schedulability bound is very close
to 0%.
1
Schedulability Bound
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
−5
10
−4
10
−3
−2
10
10
nτ /D
0
−1
10
0
10
min
Figure 9. Schedulability Bound with the Optimal TTRT Selection
5. COMPARISON WITH EXISTING RESULTS
We now compare the newly derived schedulability bound with the results of static priority scheduler
and the timed token ring scheduler.
5.1 Comparison with Static Priority Schedulers
In this section, we will compare the newly derived schedulability bound with those of the static priority
scheduler. For the sake of simplicity, we focus on periodic tasks and assume that overhead ratio α of the
weighted round robin schedule is 0.
24
a).
Consider a set of periodic tasks with deadlines equal to their periods. A schedulability bound for
the rate monotonic scheduler is 69% [17]. For the same task system and WRR scheduler, we
know that μ = 1 and k = 1 . By substituting these parameters into (4-1), we have a
schedulability bound of γ /(γ + 1) . The curve of this function in plotted in Figure 10. As can be
seen from Figure 10, the bound of the weighted round robin scheduler is lower than the bound of
static priority schedulers when γ < 2.26 . When γ = 2.26 , the weighted sound robin scheduler
achieves the same 69% bound. When γ > 2.26 , WRR out-performs the rate monotonic
scheduler in term of higher schedulability bound. This phenomenon can be explained by the
nature of the two types of schedulers. Static priority scheduler renders service to a job only if no
higher priority job is waiting to be executed, even though completing the lower priority job first
may avoid missing a deadline. In other words, static priority scheduler may allocate more
service time to high priority tasks than what is needed to guarantee the deadlines, while WRR
scheduler assigns task service time in proportional to its workload rate which avoids overallocation of service time to certain tasks. As such, WRR scheduler can out-perform static
priority scheduler under certain situation.
b).
For a set of periodic tasks with deadlines being half as long as their periods, a schedulability
bound for the rate monotonic scheduler is 50% [16]. For the same task system with the WRR
scheduler, we know that μ = 1 , and k=1/2. By substituting these parameters into (4-1), we have
a bound of γ / ( 2(γ + 1) ) . Since γ / ( 2(γ + 1) ) ≤ 1/ 2 , we know that the rate monotonic
scheduler out-performs the WRR scheduler in this case. However, when we increase token
rotation frequency γ, the schedulability bound of WRR scheduler is approaching the 50% bound
and attains it when γ → ∞ .
c).
For a set of periodic tasks with deadlines being twice as long as their periods, a schedulability
bound for the rate monotonic scheduler is 81% [16]. For the same task system with the WRR
25
scheduler, we know that μ = 1 , and k=2. By substituting these parameters into (4-1), we have a
bound of γ /(γ + 1) . It is easy to see that when γ = 4.32 , the WRR scheduler achieves the same
bound as the rate monotonic scheduler and out-performs it when γ further increases.
1
Schedulability Bound
0.9
0.8
0.7
69%
0.6
0.5
0.4
0.3
0.2
0.1
0
0
10
2.26
1
10
2
γ
10
3
10
Figure 10. Schedulability Bound With μ = 1
Based on the above analysis, we know that for the periodic tasks, weighted round robin scheduler can
achieve the same or even higher schedulability bound than the rate monotonic schedulers. We should note
that the above analysis focuses on a very simple case in which tasks are of a periodic shape and token
rotation overhead is negligible. However, similar trends still hold for more complex cases. The fact that
weighted round robin schedulers can isolate ill-behaved tasks and can achieve the same or higher
schedulability bound than the well-known rate monotonic scheduler makes this type of scheduler
applicable to practical real-time systems.
26
5.2 Comparison with Timed Token Protocol
A close related variant of the weighted round robin scheduler is the timed token ring scheduler used in
FDDI networks [2], [3], [24], [25], [26], [27], [28], [29], [30]. In a typical FDDI timed token ring system,
there are n communication nodes connected into a ring. Each node has two types of packets: real-time and
non real-time. Real-time packets have hard deadlines, e.g. packets must be sent before their deadlines,
while non real-time packets do not have deadline requirements. Similar to the weighted round robin
scheduler, a token is rotated among the nodes in the system and the desired time to finish one round of
token rotation is denoted as TTRT . Upon receiving the token, a node will first send its real-time packets
up to the allocated units of time. Each node also keeps track the last token rotation time, denoted by TTR.
If the token arrives earlier in the last round, i.e. TTR < TTRT, then it will send its non real-time packets up
to the TTRT-TRT amount of time. The rational behind this is to "steal" the unused time slots in the last
token rotation.
Due to the interference of the non real-time packets, the service available to each node may be less,
compared with what is provided by a weighted round robin scheduler. In turn, the schedulability bound
will be lower. It has been proven in [3] that for periodic tasks with relative deadline equals to their periods
and normalized weight assignment scheme with token rotation at lease twice for any interval of length of
minimum task periods, the timed token ring scheduler has a schedulability bound of (1 − nα ) / 3 1. For
this system, by (2.21), (2.10), and (2.12), we know that k=1, μ =1, and γ =2. By substituting them into
(4-1), we know that a schedulability bound of the weighted round robin scheduler is 2(1 − nα ) / 3 , twice
of the timed token ring. Figure 11 illustrates this difference for the case of n=100.
1
In [3], the authors assumes the scheduler spend a const amount of time in round robin operations and derived a bound of (1 − α ) / 3 where
α = τ / TTRT . This bound converts to (1 − nα ) / 3 in our new definition of α = τ 0 / TTRT since τ = nτ 0 .
27
0.7
0.67
0.6
Schedulability Bound
0.5
0.4
0.33
0.3
0.2
0.1
0
0
0.001
0.002
0.003
0.004
0.005
0.006
0.007
0.008
0.009
0.01
Overhead Ratio α
Figure 11. Schedulability Bound Comparison Between WRR and Timed Token Ring Scheduler
6. FINAL REMARKS
In summary, in this paper, we derive a closed-form expression for the schedulability bound of WRR
schedulers with normalized weight assignment scheme for s-shaped tasks. The schedulability bound is
parameterized for round robin overhead ratio α , normalized token rotation ratio γ , the normalized
deadline k , and the task set workload burst-ness μ . From the general result, one can easily obtain
schedulability bounds for specific system configuration by simple plug-in of proper parameters. Our work
reported here is the first that systematically derives the schedulability bound for WRR systems. Our
results are general and can be applied to a wide range of systems. Nevertheless, these results are
preliminary and can be easily extended to other type of task workloads and weight assignment scheme.
28
REFERENCES
[1] T. Abdelzaher and C. Lu, “Schedulability analysis and utilization bounds for highly scalable real-time services,” Proc. 7th
Real-Time Technology and Applications Symposium, Taipei, Taiwan, 2001, pp. 15-25.
[2] G. Agrawal, B. Chen, and W. Zhao, “Local synchronous capacity allocation schemes for guaranteeing message deadlines
with the timed token protocol”, in Proc. IEEE INFOCOM'93, San Francisco, CA, Mar. 1993, pp. 186-193.
[3] G. Agrawal, B. Chen, W. Zhao, and S. Davari, “Guaranteeing synchronous message deadlines with the timed token
protocol,” IEEE Trans. Computers, vol. 43, no. 3, pp. 327–339, Mar. 1994.
[4] B. Andersson, “Static-priority scheduling on multiprocessors,” Ph.D. dissertation, Dept. Computer Engineering., Chalmers
Univ. of Technology, Göteborg, Sweden, 2003.
[5] T. P. Baker, “Multiprocessor EDF and deadline monotonic schedulability analysis,” Proc. 24th IEEE Int. Real-Time Systems
Symposium, Cancun, Mexico, 2003, pp. 120-129.
[6] E. Bini, “Schedulability analysis of periodic fixed priority systems,” IEEE Trans. Computers, vol. 53, no.11, pp. 1462-1473,
Nov. 2004.
[7] E. Bini, G. C. Buttazzo, and G. Buttazzo, “Rate monotonic analysis: the hyperbolic bound,” IEEE Trans. Computers, vol 52, no. 7,
pp. 933-942, Jul. 2003.
[8] J. Y. Le Boudec and P. Thiran, Network Calculus, a Theory of Deterministic Queuing Systems for the Internet, New York:
Springer-Verlag, 2001.
[9] S. Chang, “On deterministic traffic regulation and service guarantee: a systematic approach by filtering,” IEEE Trans. Inform.
Theory, vol. 44, pp. 1096-1107, Aug. 1998.
[10] S. Chang, Performance Guarantees in Communication Networks, New York: Springer-Verlag, 2000.
[11] B. Chen, G. Agrawal, and W. Zhao, “Optimal synchronous capacity allocation for hard real-time communications with the
timed token protocol”, Proc. IEEE Real-Time Systems Symposium (RTSS'92), Phoenix, AZ, Dec. 1992, pp. 198-207.
[12] D. Chen, A. K. Mok, and T.-W. Kuo, “Utilization bound revisited,” IEEE Trans. Computers, vol. 52, no. 3, pp. 351- 361, Mar.
2003.
[13] R. L. Cruz, A calculus for network delay, part I: network elements in isolation, IEEE Transactions on Information Theory, 37(1), pp.
114–131, Jan. 1991.
[14] R. L. Cruz, A calculus for network delay, part II: network elements in isolation, IEEE Transactions on Information Theory, 37(1),
pp. 132–141, Jan. 1991.
[15] J. P. Lehoczky, “Fixed priority scheduling of periodic task sets with arbitrary deadlines,” in Proc. 11th IEEE Real Time Systems
Symposium, Piscataway, NJ, 1990, pp. 201-209.
[16] J. P. Lehoczky and L. Sha, “Performance of real-time bus scheduling algorithms,” ACM SIGMETRICS Performance Evaluation
Review, vol. 14, no. 1, May 1986, pp. 44–53.
[17] C. L. Liu and J. W. Layland, “Scheduling algorithms for multiprogramming in a hard-real-time environment,” J. ACM, vol.
20, no. 1, pp. 46–61, Jan. 1973.
[18] X. Liu and T. Abdelzaher, "On Non-Utilization Bounds for Arbitrary Fixed Priority Policies," Proc. 12th IEEE Real-Time
and Embedded Technology and Applications Symposium (RTAS'06), CA, Apr. 2006, pp. 167-178.
[19] D. Oh and T. P. Bakker, “Utilization bounds for n-processor rate monotone scheduling with static processor assignment,”
Real Time Systems J., vol. 15, no. 1, pp. 183-193, Nov. 1998.
[20] A. Parekh and R. G. Gallager, “A generalized processor sharing approach to flow control in integrated services networks:
the single node case,” IEEE/ACM Trans. Networking, vol. 1, no. 3, pp. 344–357, Jun. 1993.
[21] A. Raha, N. Malcolm, Wei Zhao, "Hard real-time communications with weighted round robin service in ATM local area
networks," iceccs, First IEEE International Conference on Engineering of Complex Computer Systems (ICECCS'95), pp.
96-103, Aug. 1995.
[22] J. Wu, J.-C. Liu and W. Zhao, “On schedulability bounds of static priority schedulers,” Proc. 11th IEEE Real-Time and
Embedded Technology and Applications Symposium, San Francisco, CA, Mar, 2005, pp. 529-540.
[23] D. Xuan, C. Li, R. Bettati, J. Chen, and W. Zhao, “Utilization-based admission control for real-time applications,” Proc.
2000 Int. Conf. Parallel Processing, Toronto, Canada, 2000, pp. 251–262.
[24] S. Zhang and A. Burns, “An optimal synchronous bandwidth allocation scheme for guaranteeing synchronous message
deadlines with the timed-token MAC protocol,” IEEE/ACM Trans. Networking, vol. 3, no. 6, pp. 729-741, 1995.
[25] S. Zhang and A. Burns, “Timing properties of the timed token MAC protocol,” Proc. 6th International Conference on
Computer Communications and Networks, Sep, 1997, pp.481-487.
[26] S. Zhang and A. Burns, and T.-H. Cheng, “Cycle-time properties of the timed token medium access control protocol,” IEEE
Transactions on Computers, vol.51, no.11, pp.1362-1367, Nov. 2002.
[27] S. Zhang, A. Burns, J. Chen, and E. S. Lee, “Hard real-time communication with the timed token protocol: current state and
challenging problems,” Real-Time System, vol. 27, no. 3, Sep. 2004, pp. 271-295.
[28] S. Zhang , A. Burns, A. Mehaoua, E. S. Lee, and H. Yang, “Testing the schedulability of synchronous traffic for the timed
token medium access control protocol,”, Real-Time Systems, vol.22, no.3, pp.251-280, May 2002.
29
[29] S. Zhang and E. S. Lee, “Efficient global allocation of synchronous bandwidths for hard real-time communication with the
timed token MAC protocol,” Proc. 6th Int. Conf. Real-Time Computing Systems and Applications, Hong Kong, China, 1999,
pp. 472-479.
[30] Q. Zheng and K. G. Shin, “Synchronous bandwidth allocation in FDDI networks,” IEEE Transactions on Parallel and
Distributed Systems, vol.6 no.12, pp.1332-1338, Dec. 1995.
30
APPENDIX
Theorem 3. For WRR schedulers, a service constraint function for task Ti , is
I
⎢
⎥
Gi ( I ) = ⎢
n
⎥ Hi .
+
τ
H
∑
j
j =1
⎣⎢
⎦⎥
(A-1)
Proof. We prove this theorem based on the definition of service constraint function. Let t be an arbitrary
time instant. If at time t , all the jobs from task Ti have been served, then we can let s = t and (2.15) is
true. Now we focus the case that at time t , task Ti has backlog. Let s be the last time before t such that
Ti did not backlog. That is to say, at time s , we have
gi ( s ) = fi ( s ).
(A-2)
(
In time interval [ s , t ], the scheduler served at least ⎢ I / τ +
⎣⎢
∑
n
j =1
)
H j ⎥⎥ rounds with a serving time
⎦
(
length of H i each round. In other words, task Ti received at least ⎢ I / τ +
⎣⎢
∑
n
j =1
)
H j ⎥⎥ Hj amount of
⎦
service. Formally, we have
I
⎢
⎥
gi (t ) − gi ( s ) ≥ ⎢
n
⎥ Hi .
H
+
τ
∑
j
j =1
⎣⎢
⎦⎥
(A-3)
By substituting (A-2) into(A-3), we have
I
⎢
⎥
gi (t ) − f i ( s ) ≥ ⎢
n
⎥ Hi .
H
τ+
⎣⎢ ∑ j =1 j ⎦⎥
(A-4)
31
By comparing (A-4) with (2.15), we know that the theorem follows.
Q.E.D.
Theorem 4. A lower bound of schedulability bound with scaling parameter θ = ⎡ k ⎤ / k for weighted
round robin scheduler with normalized weight assignment, and s-shaped tasks is given by
W * (⎡k ⎤ / k ) =
1
1/ γ + 1
⋅ (1 − nα ) ⋅
1
μ
⋅ min (1, k ) .
(A-5)
Proof. By Theorem 3, we known that a service constraint function provided by task Ti by a WRR
scheduler is:
I
⎢
⎥
Gi ( I ) = ⎢
n
⎥ Hi .
⎢⎣τ + ∑ j =1 H j ⎥⎦
(A-6)
For normalized weight assignment, by (2-18) and (2-16), we have
Hi =
Wi (1)
(TTRT − τ )
W (1, Γ)
(A-7)
By substituting (A-7) into (A-6), we have the service constraint function as
I ⎥ Wi (1)
(TTRT − τ ).
Gi ( I ) = ⎢⎢
⎣ TTRT ⎥⎦ W (1, Γ)
(A-8)
By Theorem 2, we know that a schedulability bound for WRR with scaling parameter θ = ⎡ k ⎤ / k is
W * ( ⎡ k ⎤ / k ) = inf Γ∈Ω* (W ( ⎡ k ⎤ / k , Γ) ) .
(A-9)
where
32
Ω* = {Γ | ∃Ti ∈ Γ such that Fi ( I ) > Gi ( I + D)} .
(A-10)
By substituting (A-8) into (A-10) and rearrange the resulting equation, we know that a schedulability
bound is
W * ( ⎡ k ⎤ / k ) = inf Γ∈Ω* (W ( ⎡ k ⎤ / k , Γ) ) .
(A-11)
⎧
⎫
⎢ I + Di ⎥ Wi (1)
(TTRT − τ ) ⎬ .
Ω* = ⎨Γ | ∃Ti ∈ Γ such that W (1, Γ) > ⎢
⎥
⎣ TTRT ⎦ Fi ( I )
⎩
⎭
(A-12)
where
∀Γ ∈ Ω* , let us define
⎛ ⎢ I + Di ⎥ TTRT − τ
⎞
Z (i ) = min I ≥0 ⎜ ⎢
Wi (1) ⎟ .
⎥
⎝ ⎣ TTRT ⎦ Fi ( I )
⎠
(A-13)
W (1, Γ) > min i =1, 2, ..., n ( Z (i ) ) .
(A-14)
Then by (A-12), we have
By substituting (2.20) and (2.20) into (A-13), we have
⎛ ⎢ I + Di ⎥
⎞
⎜ ⎢⎣ TTRT ⎥⎦ I + D F ( D ) ⎟
i
i
i
Z (i ) = (1 − nα ) ⋅ min I ≥0 ⎜
⎟.
+
I
D
Fi ( I ) Di ⎟
i
⎜⎜
⎟
⎝ TTRT
⎠
Since
(A-15)
I + Di ⎢ I + Di ⎥
≤
+ 1 , we have
TTRT ⎢⎣ TTRT ⎥⎦
33
⎛ ⎢ I + Di ⎥
⎞
⎜ ⎢⎣ TTRT ⎥⎦ I + D F ( D ) ⎟
i
i
i
Z (i ) ≥ (1 − nα ) ⋅ min I ≥0 ⎜
⎟.
⎜ ⎢ I + Di ⎥ + 1 Fi ( I ) Di ⎟
⎜⎢
⎟
⎝ ⎣ TTRT ⎥⎦
⎠
(A-16)
It is easy to verify that
⎢ I + Di ⎥
⎢⎣ TTRT ⎥⎦
1
1
1
=
≥
=
.
1
1
1 + 1/ γ
⎢ I + Di ⎥ + 1 1 +
1+
⎢⎣ TTRT ⎥⎦
⎢ I + Di ⎥
⎢ Dmin ⎥
⎢⎣ TTRT ⎥⎦
⎢⎣ TTRT ⎥⎦
(A-17)
where Dmin and γ are defined in (2.22) and (2.21), respectively. By substituting (A-17) into (A-16), we
have
⎛ 1 I + Di Fi ( Di ) ⎞
Z (i ) ≥ (1 − nα ) ⋅ min I ≥0 ⎜
⎟.
⎝ 1 + 1/ γ Fi ( I ) Di ⎠
(A-18)
Now let I = mSi + ω where 0 ≤ ω < Si , Si is the segment length of the s-shaped workload
constraint function defined in (2.6), and m is a non-negative integer. By (2.6), we have
Fi ( I ) ≤ Fi ((m + 1) Si ) .
(A-19)
By substituting (A-19) into (A-18) and rearranging it, we have
Z (i ) ≥ (1 − nα ) ⋅
⎛ mSi + ω + Di Fi ( Di ) ⎞
min I ≥0 ⎜
⎟.
1/ γ + 1
⎝ Fi ( (m + 1) Si ) Di ⎠
1
(A-20)
Since ω ≥ 0 , we have
34
Z (i ) ≥ (1 − nα ) ⋅
⎛ mSi + Di Fi ( Di ) ⎞
min I ≥0 ⎜
⎟.
1/ γ + 1
⎝ Fi ( (m + 1) Si ) Di ⎠
1
(A-21)
By (2.6) and (2.7), it can be verified that
Fi ( (m + 1) Si ) Fi ( Si )
≤
.
(m + 1) Si
Si
(A-22)
By substituting (A-22) into (A-21) and rearranging it, we get
Z (i ) ≥ (1 − nα ) ⋅
⎛ mSi + Di Fi ( Di ) ⎞
min I ≥0 ⎜
⎟.
1/ γ + 1
⎝ (m + 1) Fi ( Si ) Di ⎠
1
(A-23)
By definition of s-shaped workload constraint function in (2.6) and k in (2.11), we know that
Fi ( Di ) = Fi (kSi ) = Fi ( ⎡ k ⎤ Si ) .
(A-24)
By substituting (A-24) into (A-23), we have
Z (i ) ≥ (1 − nα ) ⋅
⎛ mSi + Di Fi ( ⎡ k ⎤ Si ) ⎞
min I ≥0 ⎜
⎟.
kSi
1/ γ + 1
⎝ (m + 1) Fi ( Si )
⎠
1
(A-25)
By substituting (2.10) into (A-25) and rearranging the resulting inequality, we have
Fi ( ⎡ k ⎤ Si ) ⎞
m+k
⎛
min I ≥0 ⎜
⎟.
k
1/ γ + 1
⎝ (m + 1) Fi ( Si )
⎠
(A-26)
1 F( k S )
m+k ⎞
⋅ ⋅ i ⎡ ⎤ i min m =0, 1, 2, ... ⎛⎜
⎟.
1/ γ + 1 k Fi ( Si )
⎝ m +1 ⎠
(A-27)
Z (i ) ≥ (1 − nα ) ⋅
1
Rewrite (A-26) into
Z (i ) ≥ (1 − nα ) ⋅
1
35
It can be verified that
⎛m+k ⎞
min m =0, 1, 2, ... ⎜
⎟ ≥ min (1, k ) .
⎝ m +1 ⎠
(A-28)
By substituting (A-28) into (A-27), we have
1
1 Fi ( ⎡ k ⎤ Si )
min (1, k ) .
Z (i ) ≥ (1 − nα ) ⋅ ⋅
k 1/ γ + 1 Fi ( Si )
(A-29)
By (2.6) and (2.7), we have
Fi ( ⎡ k ⎤ Si ) ⎡ k ⎤ ⎡ k ⎤
=
≥
.
Fi ( Si )
μi
μ
(A-30)
By substituting (A-30) into (A-29), we get
Z (i ) ≥ (1 − nα ) ⋅
1
k
⋅ ⎡ ⎤ ⋅ min (1, k ) .
1/ γ + 1 k μ
(A-31)
By substituting (A-31) into (A-14), we have
W (1, Γ) ≥ (1 − nα ) ⋅
1
⎡k ⎤
1/ γ + 1 k μ
min (1, k ) .
(A-32)
By (2.6), we know that
W (1, Γ ) = ∑ i =1
n
Fi ( Di ) ⎡ k ⎤ n Fi ( ⎡ k ⎤ Si ) ⎡ k ⎤ n
k
⎛
⎞
⎛
⎞
=
=
W ⎜ ⎡ k ⎤ , Γ ⎟ = ⎡ ⎤ W ⎜ ⎡ k ⎤ , Γ ⎟ .(A-33)
∑
∑
i =1
i =1
Di
k
k
k
⎝ k
⎠
⎝ k
⎠
⎡ k ⎤ Si
By substituting (A-33) into (A-32) and rearrange the resulting inequality, we have
36
W ( ⎡ k ⎤ / k , Γ ) ≥ (1 − nα ) ⋅
1
⋅
1
1/ γ + 1 μ
⋅ min (1, k ) .
(A-34)
Since (A-34) is true ∀Γ ∈ Ω* , we know that
inf Γ∈Ω* (W ( ⎡ k ⎤ / k , Γ) ) ≥ (1 − nα ) ⋅
1
⋅
1
1/ γ + 1 μ
⋅ min (1, k ) .
(A-35)
Then by substituting (A-35) into (A-9), we get
W * ( ⎡ k ⎤ / k ) ≥ (1 − nα ) ⋅
1
⋅
1
1/ γ + 1 μ
⋅ min (1, k ) .
Comparing (A-36) with (A-5), we have the theorem proven.
(A-36)
Q.E.D.
When the TTRT takes the optimal value, the schedulability bound is given by
W * ( ⎡k ⎤ / k ) =
⎛
⎞ 1
nτ
1
⋅ ⎜1 − 0 γ * ⎟ ⋅ ⋅ min (1, k ) .
1/ γ * +1 ⎝ Dmin
⎠ μ
(1-37)
Theorem 4. The schedulability bound of a WRR scheduler, for a given set of tasks, is maximized when
the value of TTRT is selected as follows:
TTRT = Dmin / γ * ,
(A-38)
where
37
⎧
⎪1
⎪
⎪
⎪
γ * = ⎨ ⎣⎢ Dmin / nτ 0 + 1 ⎦⎥ − 1
⎪
⎪
⎪
⎪ ⎢⎡ Dmin / nτ 0 + 1 ⎥⎤ − 1
⎩
if nτ 0 / Dmin ≥ 1/ 3
if nτ 0 / Dmin < 1/ 3 and
(
) (
)
Z ⎢⎣ Dmin / nτ 0 + 1 ⎥⎦ − 1 <Z ⎡⎢ Dmin / nτ 0 + 1 ⎤⎥ − 1
,
(A-39)
otherwise
and
Z ( x) =
⎛
⎞
nτ
1
⋅ ⎜1 − 0 x ⎟ .
1/ x + 1 ⎝ Dmin ⎠
(A-40)
When the TTRT takes the optimal value, the schedulability bound is given by
W * ( ⎡k ⎤ / k ) =
⎛
⎞ 1
nτ
1
⋅ ⎜1 − 0 γ * ⎟ ⋅ ⋅ min (1, k ) .
1/ γ * +1 ⎝ Dmin
⎠ μ
(A-41)
Proof: By (4-1), we know that a schedulability bound is
W * ( ⎡k ⎤ / k ) =
1
1/ γ + 1
⋅ (1 − nα ) ⋅
1
μ
⋅ min (1, k ) .
(A-42)
Let us define
ω = Dmin − γ ⋅ TTRT .
(A-43)
where γ is defined in (2.21). By (2.21), we have
ω ≥0.
(A-44)
By substituting (A-43) and (2.21) into (A-42), we have
38
W * ( ⎡k ⎤ / k ) =
⎛
nτ 0
⋅ ⎜⎜1 −
1/ γ + 1 ⎝ ( Dmin − ω ) / γ
1
⎞ 1
⎟⎟ ⋅ ⋅ min (1, k ) .
⎠ μ
(A-45)
It is easy to see that (A-45) will be maximized when ω = 0 and the maximum will be
W * ( ⎡k ⎤ / k ) =
⎛
⎞ 1
nτ
⋅ ⎜ 1 − 0 γ ⎟ ⋅ ⋅ min (1, k ) .
1/ γ + 1 ⎝ Dmin ⎠ μ
1
(A-46)
Now, we need to find a value of γ , γ = 1, 2, ... , that maximizes (A-46). Clearly, the value of γ that
maximizes (A-46) will also maximize
Z (γ ) =
⎛
⎞
nτ
1
⋅ ⎜1 − 0 γ ⎟ .
1/ x + 1 ⎝ Dmin ⎠
(A-47)
We can rewrite (A-47) as follows:
⎞
⎛
nτ 0
nτ
1 ⎞ ⎛
) − 0 (γ + 1) ⎟ .
Z (γ ) = ⎜1 −
⎟ ⋅ ⎜ (1 +
Dmin
Dmin
⎝ γ +1⎠ ⎝
⎠
(A-48)
An equivalent form of (A-48) is given by:
Z (γ ) = 1 + 2
nτ 0
nτ
− 0
Dmin Dmin
⎛ Dmin
⎞
1
+ 1)
+ (γ + 1) ⎟ .
⎜(
γ +1
⎝ nτ 0
⎠
(A-49)
Since Dmin ≥ TTRT ≥ nτ 0 , by calculating the derivation of (A-49) over γ , we know that (A-49) will
be maximized when γ =
Dmin / nτ 0 + 1 − 1 . But since γ can only take positive integer value, we know
that (A-49) will attain its maximum either at
(
)
γ 0 = max 1, ⎢⎣ Dmin / nτ 0 + 1 ⎥⎦ − 1 ,
(A-50)
39
or
γ 1 = ⎡⎢ Dmin / nτ 0 + 1 ⎤⎥ − 1 .
(A-51)
That is, the optimal value of TTRT that maximizes the schedulability bound is:
⎧ Dmin / γ 0
⎪
TTRT = ⎨
⎪D / γ
⎩ min 1
if Z ( γ 0 ) ≤ Z ( γ 1 )
.
(A-52)
otherwise
It is easy to verify that when Dmin / nτ 0 ≤ 3 , γ 0 = γ 1 = 1 and thus (A-52) is equivalent to
TTRT = Dmin / γ * ,
(A-53)
where
⎧1
⎪
⎪
γ * = ⎨ Dmin / γ 0
⎪
⎪⎩ Dmin / γ 1
if Dmin / nτ 0 ≤ 3
if Dmin / nτ 0 > 3 and Z ( γ 0 ) <Z ( γ 1 ) .
(A-54)
otherwise
By substituting (A-54) into (A-46), we know that the maximum schedulability bound
W * ( ⎡k ⎤ / k ) =
⎛
⎞ 1
nτ
1
⋅ ⎜1 − 0 γ * ⎟ ⋅ ⋅ min (1, k ) .
1/ γ * +1 ⎝ Dmin
⎠ μ
is attained when TTRT = Dmin / γ * . Hence, the theorem follows.
(A-55)
Q.E.D.
40
© Copyright 2026 Paperzz