A Model of Hierarchical Real-Time Virtual Resources Xiang (Alex) Feng, Aloysius K. Mok Department of Computer Sciences University of Texas at Austin, Austin, TX 78712 fxf,
[email protected] Abstract
application task group may be programmed as if it had dedicated access to a physical resource, i.e., without interference from other task groups due to resource sharing. Tasks within the same application task group are scheduled by an application-task-level scheduler that is specialized to the real-time requirements of the tasks in the group. The problem of preventing interference between two task groups cannot in general be solved by simply reserving a fixed portion of the physical resource’s time to a task group because different task groups may have different time granularity requirements. For example, a task group that is promised one tenth of a CPU’s cycles may get one millisecond out of every ten milliseconds of CPU time, or it may get one second of contiguous CPU time and must wait for 9 seconds before getting CPU time again. If the timing constraints on the task group requires response times on the order of a millisecond, then neither a ten-millisecond nor ten-second service provision cycle would suffice, since the task group may not get any CPU time for more than a millisecond. Even if the time granularity is on the order of the response time requirements of the task group, say 100 microseconds per millisecond, the programmer still needs to contend with a jitter problem since there may be as much as 1.8 milliseconds in which the task group may not get any CPU time. In contrast, the abstraction of a real-time virtual resource[12] guarantees that a task group that has been promised a fraction of a resource will receive at least L units of the resource’s time in any interval of length L + for any value of L, where is a design parameter, a non-negative number specified by the programmer. We call the delay bound of the real-time virtual resource. The delay bound is enforced by the operating system.
A real-time virtual resource is an abstraction for resource sharing where application task groups must meet timing constraints and knowledge of all the timing requirements may not be available for a global schedulability analysis, such as is the case in the open system environment. In [12], we introduced the notion of a real-time virtual resource which operates at a fraction of the rate of the shared physical resource and whose rate of service provision varies with time but is bounded. The shared resource is partitioned into real-time virtual resources by a resource-level scheduler such that each real-time virtual resource is accessible only by an individual application task group; tasks within the same task group are scheduled by an application-tasklevel scheduler that is specialized to the real-time requirements of the tasks in the group. In this paper, we propose a hierarchical real-time virtual resource model that permits resource partitioning to be extended to multiple levels. Through this model, partitions on each level are scheduled as if they had access to a dedicated resource and there is minimal interference between neighboring partition levels. We also investigate the partitioning of real-time virtual resources subject to scheduling quantum requirements. Keywords: Real-time virtual resource, Resource partition, Open system, Real-time scheduling, Scheduling Quantum.
1 Introduction The notion of a real-time virtual resource was introduced in [12] for abstracting resource sharing where a physical resource such as a CPU is shared by application task groups that are subject to different types of timing constraints. Sharing is enforced by some kind of partitioning scheme that time-multiplexes the physical resource among the different application task groups with the goal that each
The real-time virtual resource abstraction has the advantage that it directly bounds the jitter in the rate of service provision of a virtual resource in a way that is independent of granularity. This way, if we know that an event e will occur within L time units from another event e0 assuming that the resource operates at a uniform rate and event occurrence depends only on resource consumption (i.e., virtual time progresses uniformly), then e and e0 will be apart by at
This research is supported partially by ONR grants N00014-99-10402 and N00014-98-1-0704, the DARPA NEST program and NSF grant CCR-0207853
1
most L + time units in real time. This allows real-time tasks to be written as if they execute on dedicated CPUs of almost uniform speed modulo the delay bound . The delay bound can be specified by the programmer to stay within bounds of the jitter tolerances of the task group. The operating system partitions the shared physical resource to satisfy the delay bound requirements of the different task groups. If infinite time-slicing of the resource is possible, each task group could have exclusive access to a virtual resource whose rate of service provision is uniform with a delay bound of zero. In practice, small delay bounds may incur significant partition scheduling overheads and so delay bounds ought not be smaller than is necessary to satisfy jitter tolerances. In [12], we showed how schedulability analysis can be performed for the earliest-deadline-first and the fixedpriority schedulers in the context of the real-time virtual resource, where a real-time task group is characterized by the standard real-time task model of Liu and Layland [10]. We showed that the schedulability analysis can be performed without global knowledge of all the task groups that share the physical resource. For each task group, the schedulability analysis only needs to take into account the delay bound of the real-time virtual CPU on which the task group executes; as long as the sum of the worst-case response time of a task and the jitter introduced by the delay bound does not exceed the task’s deadline, the task is schedulable. This is important for the open system environment[4] where global knowledge of the task groups is assumed to be unavailable. In [11], we discussed how to exploit the concept of regularity that was first introduced in [14] in realizing the delay bounds of real-time virtual resources. For the case of regular partitions, we showed that the utilization bounds of both fixed-priority scheduling and dynamic-priority scheduling remain unchanged from those for dedicated resources. We determined the utilization bounds for the more general case of irregular partitions. In particular, both types of partitions can be efficiently constructed by exploiting the compositionality properties vis-a-vis a regularity measure. In this paper, we shall generalize the previous results to a hierarchical resource partitioning scheme where a realtime virtual resource can itself be partitioned recursively to yield multiple (slower) real-time virtual resources. Consider for example, network bandwidth as a resource. An inter-continental backbone network on which real-time applications run will probably be shared (partitioned) by large telecommunication companies; then within each individual company, its acquired bandwidth will likely be redistributed among smaller regions such as states. This type of partitioning may be applied again and again down to the level of distributing bus cycles. For this hierarchical real-time virtual resource model, we shall show that partitions on each level of a hierarchy can be scheduled as if they had ac-
cess to a dedicated resource and there is minimal interaction between neighboring levels in a hierarchy. For resources that have atomicity constraints in sharing such as indivisible communication bus cycles, we shall consider the notion of a scheduling quantum which is the minimum time slice of a resource that can be assigned to a partition. We shall investigate the partitioning problem with scheduling quantum size constraints. We shall consider not only partitions with different quantum size requirements on different levels but also partitions with different quantum size requirements on the same level in the resource partition hierarchy. It should be emphasized that the quantum size is a construct for atomicity enforcement and not for granularity specification inasmuch as scheduling by itself does not eliminate and may in fact create jitter. Throughout the paper it is assumed that time values have the domain of the non-negative real numbers unless otherwise stated. Preemptive scheduling is assumed, i.e., a task executing on the shared resource can be interrupted at any instant in time, and its execution can be resumed later. Although a resource can be a CPU, a communication bus, etc., we shall talk about a single processor as the resource to be shared. Definition 1 A task T is defined as ( ; p), where is the (worst case) execution time requirement, p is the period of the task. Even though we do not specify a per-period deadline explicitly, we shall define deadlines when they are relevant to the results in this paper. Definition 2 A task group is a collection of n tasks that are to be scheduled on a real-time virtual processor (a partition), = fTi = ( i ; pi )gni=1 . We use the term task group to emphasize its difference from the term task set in that a task set is to be scheduled on a dedicated resource while a task group is scheduled on a partition of the shared physical resource. The rest of this paper is organized as follows. Section 2 reviews the Bounded Delay Partition model. Section 3 discusses the hierarchical partition scheduling problem. In Section 4, we consider the hierarchical partition scheduling problem with quantum size requirements. We discuss some implementation issues in Section 5. We review the related work in Section 6, and end with the conclusion in Section 7.
2 The Bounded-Delay Resource Partition Model In this section we shall review a few preliminary definitions concerning the bound-delay resource partition model
presented in [12] before we discuss the hierarchical partition scheduling model. Definition 3 [12] A Resource Partition is a tuis an array of N time pairs ple ( ; P ), where f(S1 ; E1 ); (S2 ; E2 ); : : : ; (SN ; EN )g that satisfies (0 S1 < E1 < S2 < E2 < ::: < SN < EN P ) for some N 1, and P is the partition period. The physical resource is available to a task group executing on this partition only during time intervals (Si + j P; Ei + j P ); 1 i N; j 0. The above definition enumerates every time interval that is assigned to a partition and is a general representation of periodic partitioning schemes, including those that are generated dynamically by an on-line partition scheduler. It provides a starting point upon which other approaches of defining partitions may be considered.
P
Definition 4 [12] The Availability Factor (rate) of a ren source partition is a () = ( i=1 (Ei Si ))=P . The availability factor (rate) specifies what percentage of the total time of a resource is available to this particular partition. Obviously, the rate of service provision of a dedicated resource is 100%. Definition 5 [12] The Supply Function S (t) of a partition is the total amount of time that is available in from time 0 to time t. Definition 6 [12] Let h denote the execution rate of the resource where partition is implemented. The Normalized Execution of partition is an allocation of resource time to at a uniform, uninterrupted rate of (() h). Definition 7 [12] The Partition Delay of Partition is the smallest d so that for any t0 and t1 , (t1 t0 ), (t1 t0 d)() (S (t1 ) S (t0 )) (t1 t0 + d)(). Partition Delay measures the largest deviation of a partition on any time interval with regard to its being behind or ahead of its normalized execution. Definition 8 [12] A Bounded Delay Resource Partition is a tuple (;) where is the rate of the partition and is the partition delay. Theorem 1 [12] Given a task group and a bounded delay partition = (; n ), let Sn denote a valid schedule of on the normalized execution of , Sp the schedule of on Partition according to the same execution order and amount as Sn . Also let denote the largest amount of time such that any job on Sn is completed at least time before its deadline. Sp is a valid schedule if n .
In Theorem 1, actually defines the maximum allowable output jitter [3] for Sn . Therefore, informally, Theorem 1 could be written as: A task group is schedulable on a partition if the maximum allowable output jitter is no less than the partition delay.
3 Hierarchical Partition Scheduling In the previous section, the Bounded Delay Resource Partition is defined implicitly with respect to a physical resource. In general, a partition may also reside directly inside another partition instead of a physical resource, and these partitions form a hierarchy. In this section, we shall first prove a schedulability result on hierarchical partitioning. Then we shall discuss how to perform the actual scheduling.
3.1 Partition Schedulability
P
Theorem 2 A partition group fi (i ; i )g (1 < i n) n is schedulable on a partition (; ) if i=1 i and i > for all i, (1 < i n). Proof: To prove the theorem we first construct a schedule, then we show why the resulting partitions satisfy the requirements. Given any partition (; ), we divide every minimum n time slice of into n + 1 parts. Since i=1 i , each of the first n parts has i = (1 < i n) of the time slice and is assigned to partition i ; the remaining n + 1st part n ( =) of the time slice and is not assigned to has 1 i=1 i n ( =) = 0, this part has a size any partition. (If 1 i=1 i of zero.) Thus we have,
P
P
P
Si (t) = i S (t) for each partition i . Let us show why all the lower level partitions satisfy the partition delay requirement. Given any interval (t1 ; t2 ),(t1 < t2 ) we have
(t2 t1 ) (S (t2 ) S (t1 )) (t2 t1 + )
t1 ) i (S (t2 ) S (t1 )) i i (t2 t1 + ) (t2
Supply
(t2
t1 )i
(Si (t2 ) Si (t1 )) (t2 t1 + )i
4
3
2
Virtual Time Actual Time 1
(t2
t1 i )i
(Si (t2 ) Si (t1 )) (t2 t1 + i )i Therefore, they satisfy the partition delay requirement. Notice that Theorem 2 requires i > instead of i . The theorem no longer holds if i = . For instance, Partitions 1 (0:5; 0) and 2 (0:2; 0) cannot be scheduled on Partition (1:0; 0). Generally speaking, scheduling partitions within partitions will create more partition delay. Theorem 2 provides a method to determine the schedulability of scheduling partitions ( a partition group) on another partition. However, it does not explain how to perform the actual scheduling since the infinite time slicing scheme that is used in the proof is impractical. Therefore, the question remains how to schedule partitions using methods with finite context switch overhead.
3.2 Partition Scheduling Algorithm In this section, we propose a scheduling scheme that transforms the problem of scheduling partitions on partitions back to the one of scheduling partitions on resources. We shall first present the notion of virtual time scheduling; then we shall introduce the scheduling scheme and we shall also prove the validity of this scheme. Definition 9 Virtual Time V (t) = S(t) .
Intuitively, virtual time V (t) is the time point in the normalized execution that the actual time t corresponds to in an actual execution. On the supply function graph, virtual time corresponds to the time point on the normalized function with the same amount of supply as the actual time on the supply function. Definition 10 Actual Time P (t) of a virtual time t is defined as the smallest time value such that V (P (t)) = t. Actual Time may be considered as a quasi-inverse function of Virtual Time. Although virtual time function is not a one-to-one mapping, we may impose a minimum operator on the mapping, thus eliminating all many-to-one mappings except for the earliest time points. As shown in Figure 1, even though V (P (t)) = t is true by definition, P (V (t)) = t might not be true because more than one actual time point could map to the same virtual time point.
0
1
2
3
4
5
6
7
8
9
Time
Figure 1. Actual Time vs. Virtual Time Definition 11 Virtual Time Scheduling on a partition is the imposition of the constraint on the application task-level scheduler such that a job is eligible to run only when it is released and its release time is no less than the current virtual time of . In short, Virtual Time Scheduling is a scheduling scheme whereby schedules are performed according to virtual time instead of physical time. Obviously this scheme could be applied to all known scheduling algorithms designed for dedicated resources. Therefore, we have Virtual Time Rate Monotonic Scheduling, Virtual Time Earliest-DeadlineFirst Scheduling, and other virtual time scheduling algorithms. Theorem 3 Given a partition group fi (i ; i )g (1 < i n) to be scheduled on a partition (; ). Let Sn denote a scheduler of scheduling 0i (i =; i ) (1 < i n) on a dedicated resource with capacity of the same as the normalized execution of . Also let Sp denote the virtual time Sn scheduler of scheduling i on . Then Sp is valid if Sn is valid. Theorem 3 justifies the observation that we may use essentially the same algorithms of scheduling partitions on dedicated resources for hierarchical partitioning by applying the virtual time scheduling scheme. We describe this method in two steps:
Construct Scheduler Sn . For any interval (t1 ; t2 ) assigned to (P (t1 ); P (t2 )) to i in Sp .
0i
in Sn , assign
Informally, time on different levels may be expressed in the following way: Higher Level Actual Time: Higher Level Virtual Time:
t (t ; t + )
Lower Level Virtual Time:
((t (i
)); i.e.,
(t + + (i ))) (t i ; t + i )
Proof: Let (t1 ; t2 ) denote an interval on 0 in Sn . and 0t1 = P (t1 ) and t02 = P (t2 ). Also let Si (t)i and S (t) i denote the supply functions for i and 0i respectively. We 0
have
Si (t2 ) Si (t1 ) = Si (P (t2 )) Si (P (t1 )) = Si (t02 ) Si (t01 ) 0
0
(0:2; 0:5); (0:5; 1); (0:2; 2)
Therefore
(t2 t1 (i ))i = (Si (t2 ) Si (t1 ))= (t2 t1 + (i ))i =
0
(V (P (t2 )) V (P (t1 )) (i 0
i
(S (t02 )= S (t01 )= (i (Si (t2 ) Si (t1 )) (S (t02 )= S (t01 )= + (i 0
4 Partition Scheduling with Quantum Size Requirements
))i
0
i
The utilization factor is (0.2/0.5+0.5/1+0.2/2)=1.0. They are schedulable by using Earliest Deadline First Algorithm.
0
(S (t2 ) S (t1 )) (V (P (t2 )) V (P (t1 )) + (i
))i ))i
0
((t02 t01 )= (i (Si (t2 ) Si (t1 )) ((t02 t01 )= + (i 0
))i ))i
0
))i
(t0
0 2 t1 i )i (Si (t02 ) Si (t01 )) (t02 t01 i )i
Example 1 Let us schedule Partitions 1 (0:2; 5), 2 Partition (0:5; 4). Using this method, the scheduling problem is transformed into scheduling
(0:25; 6) and 3 (0:05; 8) on
(0:2=0:5; 5 4); (0:25=0:5; 6 4); (0:05=0:5; 8 4) i.e.,
between two consecutive jobs, thus converting the partition level scheduling problem into a scheduling problem with temporal distance constraints which could be solved by halving the amounts of orginal computation time and period length. Therefore, the problem in the example may be eventually converted into an equivalent problem of scheduling three tasks with (computation time, period) given by ( =2; =2), respectively,
(0:4; 1); (0:5; 2); (0:1; 4)
on a dedicated resource. Suppose we use the simple halfhalf algorithm described in [12]. This algorithm considers the partition delay as the maximum temporal distance
So far, we have discussed the partition scheduling problem with regard to bounded delay resource partition, assuming that context switching may occur at any time. In practice, this assumption might not hold because the nature of the resource may necessitate a quantum-size requirement to enforce atomicity in sharing. In fact, it may be argued that all discrete-time computing devices have quantum-size requirements since on the micro-instruction level, machine instructions are not interruptible, thus prohibiting context switch from occurring at those time points. Therefore, in this section, we shall investigate the partition scheduling problem with quantum (size) requirements. We shall first review some notions concerning regularity partitions. Then we shall look at the scheduling problem where all partitions have the same quantum size and finally we study partitions having different quantum sizes. Definition 12 The quantum size Q of a partition is the smallest length of time of which any continuous available interval of is a multiple. Definition 13 An Extended Bounded Delay (EBD) partition with quantum is a tuple (; ; Q), (0 < 1; 0; Q 0), where is the availability factor of the partition, is the partition delay and Q is the partition quantum. When Q = 0, is called a real-number partition that (in this special case) allows infinite time-slicing. Example 2 EBD Partition (1/6, 5, 1) may be considered as a Bounded Delay Partition (1/6,5) with quantum size of 1. The difference of the partition scheduling problem for EBD partitions from Bounded Delay partitions is that for EBD partitions, context switching may occur only at certain discrete time points, as opposed to any time point for the case of real-number partitions.
Definition 14 Integer EBD Partitions are EBD Partitions with quantum size of 1. There is an upper bound restriction on the quantum size. Theorem 4 The maximum unavailable time interval of Partition (; ) is and the maximum available time interval is ( (1 ) ). Proof: Consider an available time interval and an adjacent unavailable time interval of Partition as shown in Figure 2. Let t1 and t2 denote the start point and the end point of the available time intervals respectively. Let t3 denote the end point of the unavailable time interval. According to the definition of the delay bound,
(S (t3 ) S (t2 )) (t3 1111111 0000000 0000000 1111111 0000000 1111111 0000000 1111111
t1
t2
t2 )
1111111 0000000 0000000 1111111 0000000 1111111 0000000 1111111
t3
Figure 2. Quantum Size Limit
t2 because otherwise
We show that t3
(t3
(n1
t2 ) > 0 t1 + )
t1 ) t2 t1 + ) (t2 t1 ) ( ) (1 )
(t2
Theorem 6 A partition group which consists of integer partitions i (i ; i ; 1) (1 < i n) is schedulable on a partition (; ; 1) if partition group 0i (i =; (i ); 1) is schedulable on a dedicated resource.
The maximum available time interval is actually the maximum quantum size possible for partitions with quantum requirement to meet. Therefore, we have Corollary 1 The maximum quantum size of Partition
(; ) is ( (1 ) ).
n0 i =Q)i
Therefore S1 is a valid schedule for 0i , i.e., partition group i is also schedulable on a dedicated resource. Every step above is reversible, and hence sufficiency also holds.
which is a contradiction. Similiarly we have
(S (t2 ) S (t1 )) (t2
(Qn1 Qn0 i )i S0 (Qn1 ) S0 (Qn0 ) (Qn1 Qn0 + i )i
S1 (n1 ) S1 (n0 ) (n1 n0 + i =Q)i
S (t3 ) S (t2 ) = 0 while
Proof:We shall first construct a mapping between these two schedules and then show that they are essentially equivalent. We label the schedule for i as S0 and the schedule for 0i as S1 . We use S0 (t) and S1 (t) to denote their supply functions respectively. Since they both have specific quantum sizes, we shall only consider those time points that are multiple of Q for S0 and integers for S1 . To show the necessity, given S0 we shall construct S1 as follows: Let n denote a non-negative integer. Construct (n; n + 1) in S1 according to (nQ; (n + 1Q)) in S0 , i.e., if during interval (nQ; (n + 1))Q in S0 the resource is available (or unavailable) to i , it is also available (or unavailable) to 0i during interval (n; n + 1) in S1 . Since every Q units of supply in S0 is mapped to every 1 unit of supply in S1 , we have S1 (nQ) = S0 (n)Q. Therefore, for any interval (n0 ; n1 ) in S1 we have
For the rest of the paper, we assume that the quantuam size values are all within the proper bounds. Now we turn to partition scheduling problem with quantum size requirement. We shall first focus on the scheduling problem of Integer EBD partitions and later extend the results to General EBD partitions. Theorem 5 EBD Partition group fi (i ; i ; Q)g (1 < i n) is schedulable on a dedicated resource if and only if EBD Partition group i (i ; i =Q; 1) (1 < i n) is also schedulable on a dedicated resource.
Proof: Since the 0i s are schedulable on a dedicated resource, according to Theorem 5, it follows that (i =; (i ); 1=) (1 < i n) are schedulable on a dedicated resource. We use S to denote a valid schedule for it. Using the partition scheduling method described in Section 3.2 to construct a schedule on partition , we have a schedule of partitions i on a partition (; ; 1). Since S is constructed on a dedicated resource but with a lower speed of the resource where resides and the ratio of this lower speed to the speed of the dedicated resource is , units of time in S will be mapped to 1 unit of time in . Therefore, the quantum size also conforms to the requirements. Theorem 6 also transforms the scheduling problem of partitions within a partition back to the problem of partitions on a dedicated resource.
Example 3 Consider scheduling Partitions 1 (1=2; 1; 1) and 2 (1=6; 5; 1) on 3 (2=3; 1; 1). Obviously, they are schedulable while ((1=2)=(2=3); 1 1; 1) = (3=4; 0; 1) is not a schedulable partition on a dedicated resource. Similar to context switching, partition delay may occur in any time interval for real-number partitions while for partitions with non-zero quantum size it may occur only in intervals that both start and end at quantum boundary time points. We shall not explore this property in scheduling methods any further in this paper because we want to put more emphasis on achieving complete isolation between different partition levels and also on designing a clean model to capture the overall characteristic of partitions. We can easily extend Theorem 6 to partitions with different quantum sizes on different levels. Corollary 2 A partition group fi (i ; i ; Q0 )g (1 < i n) is schedulable on a partition (; ; Q) if Q is a multiple of Q0 and partition group 0i (i =; Q0 =Q(i ); 1) is schedulable on a dedicated resource. Now we consider partitions with different quantum size requirements. partition group fi (i ; i ; Qi )g (1 < i n) is schedulable on a partition (; ; Q) if Q is a multiple of LCM (Qi ) and partition group 0i (i ; i ; LCM (Qi )) is schedulable on where LCM (Qi ) is the least common multiple of Q1 ; Q2; :::Qn . Theorem 7 A
Proof sketch: Since LCM (Qi ) is a multiple of any Qi , quantum size of LCM (Qi ) also meets the requirement of quantum size of Qi . Notice that unlike partition delay, the quantum size of higher level partitions could be larger than that of those on lower level partitions. When the parameter n in Theorem 7 is large, LCM (Qi ) might become huge, thus rendering 01 unschedulable on . Since the tasks may be scheduled not only in the lowest level partitions but also in other intermediate ones, they may be scheduled as if the partitions were all on a single level. Considering this property and Corollary 2, we may use multi-level partition (vertical) scheduling to simulate single-level (horizontal) scheduling. We suggest the following method: Suppose we are given a partition group i (i ; i ; Qi ) (1 < i n) to be scheduled on (; ; Q) and Q is a multiple of LCM (Qi ).
Step 1: Compute the divides relation of the set containing LCM (Qi ) and the Qi s. Represent this relation as a graph.
Step 2: Starting from the top level of the graph which is LCM (Qi ), schedule one level at a time using the quantum size one level up. Step 3: Repeat Step 2 down to lower levels till all partitions are scheduled or till they are found to be unschedulable.
We shall use an example to illustrate the process: Example 4 Consider scheduling partitions i (1 i 5) with quantum size 6; 4; 3; 2; 1 respectively on a partition with quantum size of 12. First, we compute the LCM (Qi ) = 12 and draw the graph of the divides relation for the set (12; 6; 4; 3; 2; 1) as shown in Figure 3. 12
6
4
3
2
1
Figure 3. Divides relation of Example 4 Second, we start from the first level which is 12. Since there is no partition to be scheduled having this quantum size we skip it. Third, we go down to the level of size 6 and 4 where 1 and 2 are about to be scheduled. We use the LCM of 6 and 4 which is 12 as the quantum size to schedule 1 and 2 . Notice 12 is also the number one level above 6 and 4 in the divides relation. Fourth, we use the unused part from the previous step which is also a partition with quantum size of 12 to schedule the lower level that consists of 3 and 4 . Again we use the LCM of 3 and 2 which is 6 as the quantum size to schedule 3 and 4 . Finally, to schedule 5 on the lowest level in the unused part from the previous step, we simply use quantum size of 1 since there is only one partition yet to be scheduled. Therefore, Partitions i (1 i 5) will finally use 12; 12; 6; 6; 1 as their scheduling quantum sizes, respectively, comparing to 12; 12; 12; 12; 12 if they use single level partition scheduling. To compute the partition of the unused part on a dedicated resource, we have the following theorem. Theorem 8 Given a partition group fi (i ; i ; Q)g (1 i n) that is scheduled on a dedicated resource
P
P P
n ( ) < 1, the unsize of Q and i=1 i the resource forms a partition 0 ((1 n ( ))=(1 n ( ); Q) . i=1 i i i=1 i
with quantum used part on n ( )); ( i=1 i
P
P
Proof: It is obvious that the availability factor and the quann ( )) and Q respectively. We tum size of are (1 i=1 i shall focus on the partition delay. Let Si (t) (0 i n) denote the supply functions of i (0 i n). Since they are scheduled on a dedicated resource which has supply function S (t) = t
Xn (S (t)) = S(t) = t i
i=0
Xn (S (t))
S0 (t) = t
i i=1 Therefore, for any time interval (t1 ; t2 ), we have
S0 (t2 ) S0 (t1 )
Xn S
= (t2
i=1
= t2
t1
n X ( (S (t )
(t2
i 2
i=1
Therefore,
t1
Xn S (t ))
i(t2 )) (t1
Xn ( (t i=1
i 2
Si (t1 )))
i=1
i
2
t1 )
((1
X )(t n
i=1
i
2
Task3
Partition1
Partition3
Task Group3
i i
Partition4
....
....
Partition5
.....
Figure 4. Virtual Resource Implementation Structure There are four elementary classes:
n
i i
......
Partition2
...
Xn ( ) i=1
Task2
Partition Root
Task Group2
X( )=((1 X )) i=1
Server
i ))
(S0 (t2 ) S0 (t1 )) Xn )(t t + Xn ( )=((1 ((1 i i i 2 1 i=1
The hierarchical and quantum-size constrained partitioning schemes in this paper provide a theoretical basis for the construction of a layer of middleware to support open system design. The full design of such a middleware layer and its evaluation will be the subject of another paper. In this section, we shall show the Application Program Interface of what a hierarchical real-time virtual resource service may appear to programmers. We take the client-server paradigm approach and the overall structure is shown in Figure 4. The client consists of a collection of task groups each of which contains a set of tasks; the server consists of a hierarchy of partitions descending from a root partition. The client may initiate service request, i.e., request for partitions by passing a partition parameter object to the server. Upon receiving a partition request, the server performs an admission test using our theory and either admits the request or rejects it.
Task1
n
i=1
5 System Application Program Interface
Partition Para
i=1
t1
P
Task Group1
(S0 (t2 ) S0 (t1 )) Xn )(t t ) + Xn ( ) ((1 i i i 2 1 i=1
P
t1 + i ))
i=1
Xn )(t
P P
Client
(S0 (t2 ) S0 (t1 )) n X (i (t2 t1 (t2 t1 ((1
i 1
i=1
Theorem 9 Given a partition group fi (i ; i ; Q)g (1 n n) that is scheduled on a partition (; ; Q)and i=1 (i ) < , nthe unused npart of forms a partition 0 (( i=1 (i )); ( i=1 (i i ) + )=( n ( ); Q) . i i=1
i
i=1
i
Xn )) i=1
i
Similarly, we can extend the result to the unused part on a partition.
Task TaskGroup VirtualResource (Partition) PartitionPara (Partition Requirement Parameters)
Let us take Virtual Resource Class as an example and look into its class definition. Class VirutualResource: static VirtualResource Root; NodeType nodeType;
VirtualResource parentResource; double rate; double delay; long quantumSize; vector subPartitions; TaskGroup taskGroup; double currentUnusedRate; SchedulingMethod schedulingMethod; long startTime; long endTime; public VirtualResource requestPartition(PartitionPara para); public void removePartition(Partition oldPartition); Let us explain some member data in more details:
Root points to the physical resource on which the virtual resource is running. It is defined as a static data member since only one physical resource is considered in this paper. There will be a list of Roots when we consider multi-resources in the future. NodeType indicates the role of the virtual resource in the hierarchical structure and can have one of three possible values: typedef enum NodeType f ROOT, BRANCH, LEAF, gNodeType;
Root means the resource is the physical resource; branch means the resource is an intermediate partition and it has, or is expected to have partitions to be scheduled on it; leaf means the resource is the lowest level partition and it has, or is expected to have tasks to be scheduled on it.
6 Related Work In [12], the concept of a real-time virtual resource was introduced which operates at a fraction of the rate of the shared physical resource and whose rate of operation varies with time but is bounded. The focus of [12] is mainly on task-level schedulability with respect to given partitions. [11] is a companion to [12] in that we discussed in detail resource-level schedulability by making use of a specific approach to partitioning: regular and k -irregular partitions. The concept of regularity was first introduced by Shigero, Takashi and Kei in [14] where they proved the feasibility of task groups whose utilization is no bigger than the availability factor of the regular partition the task group executes on. In [11], we made the more general observation that the
schedulability bound results in the Liu and Layland in fact all hold with regular partitions. We also generalized the regularity concept to include both temporal and supply regularities and gave a number of compositionality results. The real-time virtual resource concept addresses some of the crucial issues of the open system environment. As such, this paper is related to the work pioneered by Deng and Liu [4]. In the open system environment, the admission test on a real-time task needs to be independent of any other task in the system and a global schedulability analysis is out of the question. This concept was first discussed based on an EDF kernel scheduler and was later extended to the fixed priority scheduler as kernel scheduler[7]. It was further extended to parallel and distributed systems [6]. Because in an open real-time environment the parameters of real-time tasks are no longer required to be known a priori, efficient online scheduling algorithms are needed [1, 15]. Also needed are practical mechanisms to provide isolation among tasks. One interesting approach is to assign each task a server with certain parameters [2, 9]. However, the interaction between tasks and the higher-level scheduler may increase the unpredictability in task execution and hence make other requirements such as output jitter bound difficult to realize. The main difference between our approach and previous approaches is that we minimize the interaction between the resource-level scheduler and the applicationtask-level scheduler to a simple interface. Unlike previous approaches, our resource-level scheduler does not require knowledge of the task-level deadlines or their derivatives in partition scheduling. In the other direction, the task-level scheduler may need to know at most the regularity bound of the partition it executes on. More importantly, the related delay bound of the partition allows the application task scheduler to determine not only compliance with deadline requirements but also event-separation types of constraints. If the application task groups are not all specified in one common task model such as Liu and Layland periodic tasks, our partition model can still be used. We only need to figure out the schedulability conditions of the new system model on partitions. The effect of the partition scheduling on task group scheduling is captured by the partition regularity in this paper. Our work is also differentiated from Start-time Fair Queuing(SFQ) [5] and Fluctuation Constrained Server (FCS) [8]. Both SFQ and FCS have the similar notion of supply deviation for any time interval as our work. However, SFQ aims to minimize the delay to achieve nearoptimal fairness while our work measures the delay as long as the delay could guarantee the schedulability of real-time tasks. Furthermore, SFQ depends on the number of threads (which are equivalent to partitions in our work ) being scheduled; while the resource level delay in our work is specified by the partition request, thus providing stronger
guarantee. On the other hand,FCS is intended to be on per stream basis while our work is on per task group basis. FCS does not provide any real-time schedulability analysis if a group of tasks instead one single task (stream) are running on FCS, while task level scheduling is a major problem that real-time virtual resource addresses as shown in [12] and [11]. Last but not least, Regehr and Stankovic recently presented their work of Hierarchical Loadable Scheduler (HLS) in [13]. In HLS, schedulers may be converted to one another by means of service guarantees. Their goal is also quite different from ours since HLS aims at constructing a hierarchy of schedulers while our work is to construct a hierarchy of virtual resources.
7 Conclusion In this paper, we have proposed a hierarchical real-time virtual resource model. It generalizes our previous work by allowing multi-level partitioning, with or without quantum size requirements. Highlights of the our hierarchical model in this paper are:
Our approach is ideal for the open system environment with a clean separation of concerns between task group scheduling and partition scheduling across multiple levels of resource decomposition. Task group scheduling depends only on the partition parameters and is independent of how the partitions are structured. We utilize the notion of Virtual Time Scheduling to achieve a clear isolation of concerns between different levels of partitions. The scheduling problem is reduced to that within a single level and as a result the complexity of resource management in hierarchical systems can be much reduced. Partitions on each level and are scheduled as if they had access to a dedicated resource. Various cases of quantum size requirements are considered, thus providing a more practical approach to construct real-time virtual resources where context switching overheads can be significant. Our approach is eminently implementable. An API of a middleware implementation is included.
We are proceeding with the middleware service design work based on the theory reported in this paper and shall report it in the future.
References [1] S. Baruah. Overload tolerance for single-processor workloads. In Real-Time Technology and Applications Symposium, pages 2–11, 1998. [2] S. Baruah, G. Buttazzo, S. Gorinsky, and G. Lipari. Scheduling periodic task systems to minimize output jitter. In The 6th International Conference on Real-Time Computing Systems and Applications, 1999. [3] S. K. Baruah, D. Chen, and A. K. Mok. Jitter concerns in periodic task systems. In IEEE Real-Time Systems Symposium, 1997. [4] Z. Deng and J. Liu. Scheduling real-time applications in an open environment. In IEEE Real-Time Systems Symposium, pages 308–319, December 1997. [5] P. Goyal, H. M. Vin, and H. Cheng. Start-time fair queuing: A scheduling algorithm for integrated servicespacket switching networks. Technical report, Dept. of Computer Sciences, Univ. of Texas at Austin (ftp://ftp.cs.utexas.edu/pub/techreports/tr96-02.ps.Z), 1996. [6] T. Kuo, K. Lin, and Y. Wang. An open real-time environment for parallel and distributed systems. In 20th International Conference on Distributed Computing Systems, pages 206–213, 2000. [7] T.-W. Kuo and C.-H. Li. A fixed-priority-driven open system architecture for real-time applications. In IEEE Real-Time Systems Symposium, pages 256–267, 1999. [8] K. Lee. Performance bounds in communication networks with variable-rate links. In SIGCOMM, pages 126–136, 1995. [9] G. Lipari and S. Baruah. Efficient scheduling of real-time multi-task applications in dynamic systems. In Real-Time Technology and Applications Symposium, pages 166–175, December 2000. [10] C. L. Liu and J. W. Layland. Scheduling algorithms for multiprogramming in a hard-real-time environment. Journal of ACM, 20(1), January 1973. [11] A. Mok and X. Feng. Towards compositionality in real-time resource partitioning based on regularity bounds. In IEEE Real-Time Systems Symposium, pages 129–138, 2001. [12] A. Mok, X. Feng, and D. Chen. Resource partition for realtime systems. In Real-Time Technology and Applications Symposium, pages 75–84, 2001. [13] J. Regehr and J. Stankovic. Hls: A framework for composing soft real-time schedulers. In IEEE Real-Time Systems Symposium, pages 3–14, 2001. [14] S. Shigero, M. Takashi, and H. Kei. On the schedulability conditions on partial time slots. In Real-Time Computing Systems and Applications Conference, pages 166–173, 1999. [15] Y. L. T. Kuo and K. Lin. Efficient on-line schedulability tests for priority driven real-time systems. In Real-Time Technology and Applications Symposium, pages 4–13. [16] G. G. Xie and S. S. Lam. Delay guarantee of virtual clock server. IEEE/ACM Transactions on Networking, 3(6):683– 689, 1995.