• No results found

Summary and Conclusions

Rate-Based Resource Allocation Methods

4.6 Summary and Conclusions

Static priority scheduling is a popular and useful method for implementing many types of real-time and embedded systems. However, there are many aspects of practical real-time systems for which static priority scheduling methods are a poor fit. In many cases, rate-based methods can provide an alternate means of resource allocation. For example, rate-based resource allocation schemes are a good fit for providing real- time services in distributed real-time and embedded systems. Allocation schemes exist that are a good fit for the scheduling architectures used in the various layers of a traditional monolithic UNIX kernel such as FreeBSD. Three such rate-based schemes were considered: the EEVDF fluid-flow paradigm, the CBS polling server paradigm, and the generalization of Liu and Layland scheduling known as RBE. These algorithms have been shown to result in effective real-time control for three scheduling problems found in layer- structured operating systems: application-level scheduling of user programs, scheduling the execution of system calls made by applications in the “top-half ” of the operating system, and scheduling asynchronous events generated by devices in the “bottom-half ” of the operating system. For each scheduling problem, we considered the problem of network packet and protocol processing for a suite of canonical multimedia applications. We tested each implementation under three workloads: a uniform rate packet-arrival process, a bursty arrival process, and a misbehaved arrival process that generates work faster than the corresponding application process can consume it.

When work arrives at rates that match the underlying scheduling model (the constant rate sender’s case), all the policies considered achieve real-time performance. When work arrives that exceeds the application’s rate specification, only the CBS server-based scheme and the EEVDF PS scheme provide isolation between well-behaved and misbehaved applications. When work arrives in a bursty manner, the quantum-based nature of EEVDF gives less-responsive protocol processing and more packet loss. CBS performs better but suffers from CPU-time accounting problems that result in numerous missed deadlines. RBE provides the best response times but only at the expense of decreased throughput for the non-real-time activities.

The solution here was the application of different rate-based resource allocation schemes in different layers of the kernel. Specifically, EEVDF PS scheduling of applications and system calls combined with either CBS servers or RBE tasks in the bottom-half of the kernel was shown to be effective. The quantum nature of EEVDF scheduling proves to be well suited to the FreeBSD application scheduling architecture and the coarser-grained nature of resource allocation in the higher layers of the kernel. The event-driven nature of RBE scheduling gives the best response times for packet and protocol processing. Moreover, the deterministic nature of lower-level kernel processing avoids the shortcomings observed when RBE scheduling is employed at the user level.

In summary, rate-based resource allocation can be effective in realizing the performance requirements and constraints of individual layers of an operating system kernel. All of the schemes tested worked well for application-level scheduling (the problem primarily considered by the developers of each algo- rithm). However, for intrakernel resource allocation, these schemes give significantly different results. By combining resource allocation schemes it is possible to alleviate specific shortcomings.

References

1. L. Abeni, G. Buttazzo, Integrating Multimedia Applications in Hard Real-Time Systems, Proc. of the 19th IEEE Real-Time Systems Symposium, Madrid, Spain, December 1998, pp. 4–13.

2. D. Anderson, S. Tzou, R. Wahbe, R. Govindan, M. Andrews, Support for Live Digital Audio and Video, Proc. of the 10th International Conference on Distributed Computing Systems, Paris, France, May 1990, pp. 54–61.

3. A. Bavier, L.L. Peterson, BERT: A Scheduler for Best Effort and Real-Time Tasks, Technical Report, Department of Computer Science, Princeton University, 2001.

4. A. Demers, S. Keshav, S. Shenkar, Analysis and Simulation of a Fair Queueing Algorithm, Journal of Internetworking Research and Experience, October 1990, pp. 3–12.

5. P. Goyal, X. Guo, H. Vin, A Hierarchical CPU Scheduler for Multimedia Operating Systems, USENIX Symposium on Operating Systems Design and Implementation, Seattle, WA, October 1996, pp. 107–121.

6. M. Hamdaoui, P. Ramanathan, A Dynamic Priority Assignment Technique for Streams with (m,k)- Firm Deadlines, IEEE Transactions on Computers, April 1995.

7. K. Jeffay, D. Bennett, Rate-Based Execution Abstraction for Multimedia Computing, Proc. of the 5th International Workshop on Network and Operating System Support for Digital Audio and Video, Durham, NH, April 1995, Lecture Notes in Computer Science, Vol. 1018, pp. 64–75, Springer, Heidelberg.

8. K. Jeffay, S. Goddard, A Theory of Rate-Based Execution, Proc. of the 20th IEEE Real-Time Systems Symposium, December 1999, pp. 304–314.

9. K. Jeffay, G. Lamastra, A Comparative Study of the Realization of Rate-Based Computing Services in General Purpose Operating Systems, Proc. of the 7th IEEE International Conference on Real-Time Computing Systems and Applications, Cheju Island, South Korea, December 2000, pp. 81–90. 10. K. Jeffay, F.D. Smith, A. Moorthy, J. Anderson, Proportional Share Scheduling of Operating Systems

Services for Real-Time Applications, Proc. of the 19th IEEE Real-Time Systems Symposium, Madrid, Spain, December 1998, pp. 480–491.

11. M.B. Jones, D. Rosu, M.-C. Rosu, CPU Reservations and Time Constraints: Efficient, Predictable Scheduling of Independent Activities, Proc. of the 16th ACM Symposium on Operating Systems Principles, Saint-Malo, France, October 1997, pp. 198–211.

12. J. Lehoczky, L. Sha, Y. Ding, The Rate Monotonic Scheduling Algorithm: Exact Characterization and Average Case Behavior, Proc. of the 10th IEEE Real-Time Systems Symposium, Santa Monica, CA, December 1989, pp. 166–171.

13. J. Leung, J. Whitehead, On the Complexity of Fixed-Priority Scheduling of Periodic, Real-Time Tasks, Performance Evaluation, Vol. 2, 1982, pp. 237–250.

15. C.L. Liu, J.W. Layland, Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment, Journal of the ACM, Vol. 20, No. 1, January 1973, pp. 46–61.

16. LynuxWorks, LynxOS and BlueCat real-time operating systems, http://www.lynx.com/index.html. 17. Mentor Graphics, VRTX Real-Time Operating System.

18. A.K.-L. Mok, Fundamental Design Problems of Distributed Systems for the Hard Real-Time Environment, Ph.D. Thesis, MIT, Dept. of EE and CS, MIT/LCS/TR-297, May 1983.

19. J. Nieh, M.S. Lam, Integrated Processor Scheduling for Multimedia, Proc. 5th International Work- shop on Network and Operating System Support for Digital Audio and Video, Durham, NH, April 1995, Lecture Notes in Computer Science, T.D.C. Little and R. Gusella, eds., Vol. 1018, Springer, Heidelberg.

20. A.K. Parekh and R.G. Gallager, A Generalized Processor Sharing Approach to Flow Control in Integrated Services Networks—The Single Node Case, ACM/IEEE Transactions on Networking, Vol. 1, No. 3, 1992, pp. 344–357.

21. pSOS+TM/68K Real-Time Executive, User’s Manual, Motorola, Inc.

22. QNX Operating System, System Architecture and Neutrino System Architecture Guide, QNX Software Systems Ltd., 1999.

23. M. Spuri, G. Buttazzo, Efficient Aperiodic Service under the Earliest Deadline Scheduling, Proc. of the 15th IEEE Real-Time Systems Symposium, December 1994, pp. 2–11.

24. M. Spuri, G. Buttazzo, F. Sensini, Robust Aperiodic Scheduling Under Dynamic Priority Systems, Proc. of the 16th IEEE Real-Time Systems Symposium, December 1995, pp. 288–299.

25. I. Stoica, H. Abdel-Wahab, K. Jeffay, On the Duality between Resource Reservation and Proportional Share Resource Allocation, Multimedia Computing and Networking ’97, SPIE Proceedings Series, Vol. 3020, February 1997, pp. 207–214.

26. I. Stoica, H. Abdel-Wahab, K. Jeffay, S. Baruah, J. Gehrke, C. Plaxton, A Proportional Share Resource Allocation Algorithm for Real-Time, Time-Shared Systems, Proc. of the 17th IEEE Real-Time Systems Symposium, December 1996, pp. 288–299.

27. VxWorks Programmer’s Guide, WindRiver System, Inc., 1997.

28. C.A. Waldspurger, W.E. Weihl, Lottery Scheduling: Flexible Proportional-Share Resource Manage- ment, Proc. of the 1st Symposium on Operating System Design and Implementation, November 1994, pp. 1–12.

29. R. West, K. Schwan, C. Poellabauer, Scalable Scheduling Support for Loss and Delay Constrained Media Streams, Proc. of the 5th IEEE Real-Time Technology and Applications Symposium, Vancouver, Canada, June 1999.

30. G.R. Wright, W.R. Stevens, TCP/IP Illustrated, Vol. 2, The Implementation, Addison-Wesley, Reading, MA, 1995.

5

Compositional

Real-Time

Schedulability

Analysis

Insik Shin University of Pennsylvania Insup Lee University of Pennsylvania 5.1 Introduction ... 5-1 5.2 Compositional Real-Time Scheduling Framework ... 5-3

Scheduling Unit, Component, and Interface • System Models • Compositional Framework Overview • Problem Statement

5.3 Workload Models ... 5-6 5.4 Resource Models ... 5-7

Bounded-Delay Resource Model • Periodic Resource Model

5.5 Schedulability Analysis ... 5-9

Bounded-Delay Resource Model • Periodic Resource Model

5.6 Schedulable Workload Utilization Bounds ... 5-12

Bounded-Delay Resource Model • Periodic Resource Model

5.7 Extension ... 5-16

Supporting Sporadic Tasks • Supporting Interacting Tasks within a Component

5.8 Conclusions ... 5-18

5.1 Introduction

A hierarchical scheduling framework has been introduced to support hierarchical resource sharing among applications under different scheduling services. The hierarchical scheduling framework can be generally represented as a tree of nodes, where each node represents an application with its own scheduler for scheduling internal workloads (threads), and resources are allocated from a parent node to its children nodes, as illustrated in Figure 5.1. Goyal et al. [9] first proposed a hierarchical scheduling framework for supporting different scheduling algorithms for different application classes in a multimedia system.

The hierarchical scheduling framework can be used to support multiple applications while guarantee- ing independent execution of those applications. This can be correctly achieved when the system provides partitioning, where the applications may be separated functionally for fault containment and for compo- sitional verification, validation, and certification. Such a partitioning prevents one partitioned function from causing a failure of another partitioned function.

The hierarchical scheduling framework is particularly useful in the domain of open systems [7], where applications may be developed and validated independently in different environments. For example, the hierarchical scheduling framework allows an application to be developed with its own scheduling algorithm

Scheduler Workload Resource Scheduler Workload Scheduler Application Application

FIGURE 5.1 Hierarchical scheduling framework: A resource is scheduled by a scheduler and each share of the resource is subsequently scheduled by a different scheduler.

internal to the application and then later included in a system that has a different metalevel scheduler for scheduling applications.

In the real-time systems research community, there has been a growing attention to hierarchical schedul- ing frameworks [1,7,8,13,15,16,20,23–26]. Many studies have been proposed for the schedulability analysis of hierarchical scheduling frameworks. These studies commonly consider the Liu and Layland periodic task model [18], and earliest deadline first (EDF) and rate-monotonic (RM) scheduling.

Deng and Liu [7] proposed a two-level real-time scheduling framework for open systems. Kuo and Li [13] presented an exact schedulability condition for such a two-level framework with the RM system scheduler, under the assumption that all periodic tasks across components are harmonic. Lipari and Baruah [15,17] presented exact schedulability conditions for the two-level framework with the EDF system scheduler, while placing a server between the system scheduler and each component scheduler. The main role of the server is to compute the resource requirements of components at runtime so that the EDF system scheduler can use them in scheduling components. Each server is assumed to have knowledge of the task-level deadlines of its corresponding component. The common assumption shared by these previous approaches is that the system scheduler has a (schedulable) utilization bound of 100%. In open systems, however, it is desirable to be more general since there could be more than two levels and different schedulers may be used at different levels.

Mok et al. [21] introduced the notion of real-time resource model to specify the real-time resource allocation guarantees that a parent component provides to its child component in a hierarchical scheduling framework. This notion of resource model allows the parent and child components to be separated such that they interact with each other only through their resource model. This approach enables the parent and child components to have any different schedulers and allows the schedulability of the child component to be analyzed independent of its context. As a real-time resource model, they proposed the bounded-delay resource model and presented sufficient schedulability conditions for this proposed resource model [8,21,22]. Shin and Lee [26] presented the utilization bounds of the bounded-delay resource model under RM and EDF scheduling.

Another real-time resource model, the periodic resource model [25], has been proposed to specify the periodic behavior of resource allocations provided to a component from its parent component in a hierarchical scheduling framework. There has been work [1,4,16,24,25] on the schedulability analysis of a component involving the periodic resource model. Saewong et al. [24] introduced a worst-case response time analysis technique under RM scheduling. Almeida and Pedreiras [1] and Davis and Burns [4] have extended this initial technique with the notion of worst-case response time of periodic resource model;

they refined the technique for a case where the worst-case response time of periodic resource model is known. Lipari and Bini [16] and Shin and Lee [25] presented other RM schedulability conditions based on time demand calculation. Shin and Lee [25] presented an EDF schedulability condition. The utilization bounds of periodic resource models have been introduced under RM scheduling [24,25] and under EDF scheduling [25], respectively.

Shin and Lee [25,26] proposed the compositional real-time scheduling framework, where global (system-level) timing properties can be established by composing together independently (specified and) analyzed local (component-level) timing properties. They introduced two problems, component abstraction and composition, for developing such a framework. Component abstraction is to abstract the collec- tive real-time requirements of a component as a single real-time requirement, called real-time interface. Component composition is to compose independently analyzed local timing properties (represented as real-time interfaces) into a global timing property.

The common assumption shared by the aforementioned studies is that all periodic tasks are independent. Matic and Henzinger [20] considered the issue of addressing the component abstraction problem in the presence of interacting tasks within a component. They considered two approaches, the real-time workshop (RTW) [19] and the logical execution time (LET) [11] semantics, for supporting tasks with intra- and intercomponent data dependencies. They showed that previous studies [25] on hierarchical scheduling frameworks can be extended for supporting tasks with both intra- and intercomponent dependencies when one of the two approaches is employed. They also showed that these two approaches produce a trade-off between the end-to-end latency and the component abstraction overhead.

There have been studies on the development of interface theory for supporting incremental design of component-based real-time systems, applying the interface theories [5,6] into real-time context. Wandeler and Thiele [29,30] proposed an assume-guarantee interface theory for real-time components with a generic real-time interface model. Henzinger and Matic [12] proposed another assume-guarantee interface theory using the bounded-delay resource partition model [8] as a real-time interface model. Both interface theories support associative composition of components, i.e., the incremental addition of new components, and the independent stepwise refinement of existing components.

Regehr and Stankovic [23] introduced another hierarchical scheduling framework that considers various kinds of real-time guarantees. Their work focused on converting one kind of guarantee to another kind of guarantee such that whenever the former is satisfied, the latter is also satisfied. With their conversion rules, the schedulability of a child component is sufficiently analyzed such that it is schedulable if its parent component provides real-time guarantees that can be converted to the real-time guarantee that the child component demands. However, they did not consider the component abstraction and composition problems.