An Investigation into Server Parameter Selection for Hierarchical Fixed Priority Pre-emptive Systems

Similar documents
AADL : about scheduling analysis

A mathematical programming approach to the analysis, design and scheduling of offshore oilfields

Real-time Scheduling

Lecture 7 Real Time Task Scheduling. Forrest Brewer

Parallelism for Nested Loops with Non-uniform and Flow Dependences

Multitasking and Real-time Scheduling

Compiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Maintaining temporal validity of real-time data on non-continuously executing resources

6.854 Advanced Algorithms Petar Maymounkov Problem Set 11 (November 23, 2005) With: Benjamin Rossman, Oren Weimann, and Pouya Kheradpour

The Greedy Method. Outline and Reading. Change Money Problem. Greedy Algorithms. Applications of the Greedy Strategy. The Greedy Method Technique

Scheduling. In general, a scheduling scheme provides two features: An algorithm for ordering the use of system resources (in particular the CPUs)

A Binarization Algorithm specialized on Document Images and Photos

For instance, ; the five basic number-sets are increasingly more n A B & B A A = B (1)

Channel 0. Channel 1 Channel 2. Channel 3 Channel 4. Channel 5 Channel 6 Channel 7

Virtual Memory. Background. No. 10. Virtual Memory: concept. Logical Memory Space (review) Demand Paging(1) Virtual Memory

Wishing you all a Total Quality New Year!

An Optimal Algorithm for Prufer Codes *

The Codesign Challenge

Verification by testing

Assignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009.

Load Balancing for Hex-Cell Interconnection Network

Problem Set 3 Solutions

Helsinki University Of Technology, Systems Analysis Laboratory Mat Independent research projects in applied mathematics (3 cr)

Improvement of Spatial Resolution Using BlockMatching Based Motion Estimation and Frame. Integration

NUMERICAL SOLVING OPTIMAL CONTROL PROBLEMS BY THE METHOD OF VARIATIONS

Mathematics 256 a course in differential equations for engineering students

Reducing Frame Rate for Object Tracking

A Generic and Compositional Framework for Multicore Response Time Analysis

Meta-heuristics for Multidimensional Knapsack Problems

Course Introduction. Algorithm 8/31/2017. COSC 320 Advanced Data Structures and Algorithms. COSC 320 Advanced Data Structures and Algorithms

Classifier Selection Based on Data Complexity Measures *

An Iterative Solution Approach to Process Plant Layout using Mixed Integer Optimisation

CHAPTER 2 PROPOSED IMPROVED PARTICLE SWARM OPTIMIZATION

ELEC 377 Operating Systems. Week 6 Class 3

Efficient Broadcast Disks Program Construction in Asymmetric Communication Environments

Mixed-Criticality Scheduling on Multiprocessors using Task Grouping

A Frame Packing Mechanism Using PDO Communication Service within CANopen

Video Proxy System for a Large-scale VOD System (DINA)

Real-Time Systems. Real-Time Systems. Verification by testing. Verification by testing

DESIGNING TRANSMISSION SCHEDULES FOR WIRELESS AD HOC NETWORKS TO MAXIMIZE NETWORK THROUGHPUT

Feature Reduction and Selection

Petri Net Based Software Dependability Engineering

TN348: Openlab Module - Colocalization

Real-Time Guarantees. Traffic Characteristics. Flow Control

Distributed Resource Scheduling in Grid Computing Using Fuzzy Approach

Virtual Machine Migration based on Trust Measurement of Computer Node

Load-Balanced Anycast Routing

CSE 326: Data Structures Quicksort Comparison Sorting Bound

Tsinghua University at TAC 2009: Summarizing Multi-documents by Information Distance

SLAM Summer School 2006 Practical 2: SLAM using Monocular Vision

Technical Report. i-game: An Implicit GTS Allocation Mechanism in IEEE for Time- Sensitive Wireless Sensor Networks

Cluster Analysis of Electrical Behavior

Cache Performance 3/28/17. Agenda. Cache Abstraction and Metrics. Direct-Mapped Cache: Placement and Access

USING GRAPHING SKILLS

Configuration Management in Multi-Context Reconfigurable Systems for Simultaneous Performance and Power Optimizations*

Subspace clustering. Clustering. Fundamental to all clustering techniques is the choice of distance measure between data points;

Space-Optimal, Wait-Free Real-Time Synchronization

Optimized caching in systems with heterogeneous client populations

Module Management Tool in Software Development Organizations

Adaptive Resource Allocation Control with On-Line Search for Fair QoS Level

On Achieving Fairness in the Joint Allocation of Buffer and Bandwidth Resources: Principles and Algorithms

Related-Mode Attacks on CTR Encryption Mode

CHAPTER 2 DECOMPOSITION OF GRAPHS

Performance Evaluation of Information Retrieval Systems

Achieving class-based QoS for transactional workloads

Optimal Scheduling of Capture Times in a Multiple Capture Imaging System

Efficient Distributed File System (EDFS)

Problem Definitions and Evaluation Criteria for Computational Expensive Optimization

An Entropy-Based Approach to Integrated Information Needs Assessment

Simulation Based Analysis of FAST TCP using OMNET++

Insertion Sort. Divide and Conquer Sorting. Divide and Conquer. Mergesort. Mergesort Example. Auxiliary Array

Optimizing Document Scoring for Query Retrieval

Content Based Image Retrieval Using 2-D Discrete Wavelet with Texture Feature with Different Classifiers

Tolerating Transient Faults in Statically Scheduled Safety-Critical Embedded Systems

Real-time Fault-tolerant Scheduling Algorithm for Distributed Computing Systems

Complex Numbers. Now we also saw that if a and b were both positive then ab = a b. For a second let s forget that restriction and do the following.

Test-Cost Modeling and Optimal Test-Flow Selection of 3D-Stacked ICs

Response-Time Guarantees in ATM Networks

A fair buffer allocation scheme

Assembler. Building a Modern Computer From First Principles.

Dynamic Voltage Scaling of Supply and Body Bias Exploiting Software Runtime Distribution

CMPS 10 Introduction to Computer Science Lecture Notes

Comparison of Heuristics for Scheduling Independent Tasks on Heterogeneous Distributed Environments

Available online at Available online at Advanced in Control Engineering and Information Science

A Fast Content-Based Multimedia Retrieval Technique Using Compressed Data

A MOVING MESH APPROACH FOR SIMULATION BUDGET ALLOCATION ON CONTINUOUS DOMAINS

A fault tree analysis strategy using binary decision diagrams

Conditional Speculative Decimal Addition*

S1 Note. Basis functions.

Overview. Basic Setup [9] Motivation and Tasks. Modularization 2008/2/20 IMPROVED COVERAGE CONTROL USING ONLY LOCAL INFORMATION

EECS 730 Introduction to Bioinformatics Sequence Alignment. Luke Huan Electrical Engineering and Computer Science

Quality Improvement Algorithm for Tetrahedral Mesh Based on Optimal Delaunay Triangulation

An efficient iterative source routing algorithm

Today s Outline. Sorting: The Big Picture. Why Sort? Selection Sort: Idea. Insertion Sort: Idea. Sorting Chapter 7 in Weiss.

CSE 326: Data Structures Quicksort Comparison Sorting Bound

A Fast Visual Tracking Algorithm Based on Circle Pixels Matching

TECHNIQUE OF FORMATION HOMOGENEOUS SAMPLE SAME OBJECTS. Muradaliyev A.Z.

Data Representation in Digital Design, a Single Conversion Equation and a Formal Languages Approach

Evaluation of an Enhanced Scheme for High-level Nested Network Mobility

Pricing Network Resources for Adaptive Applications in a Differentiated Services Network

Transcription:

An Investgaton nto Server Parameter Selecton for Herarchcal Fxed Prorty Pre-emptve Systems R.I. Davs and A. Burns Real-Tme Systems Research Group, Department of omputer Scence, Unversty of York, YO10 5DD, York (UK) rob.davs@cs.york.ac.uk, alan.burns@cs.york.ac.uk Abstract Ths paper nvestgates the problem of server parameter selecton n herarchcal fxed prorty preemptve systems. A set of algorthms are provded that determne the optmal values for a sngle server parameter (capacty, perod, or prorty) when the other two parameters are fxed. By contrast, the general problem of server parameter selecton s shown to be a holstc one: typcally the locally optmal soluton for a sngle server does not form part of the globally optmal soluton. Emprcal nvestgatons show that mprovements n remanng utlsaton (spare capacty) can be acheved by choosng server perods that are exact dvsors of ther task perods; enablng tasks to be bound to the release of ther server, enhancng task schedulablty and reducng server capacty requrements. 1. Introducton In automotve electroncs, the advent of advanced hgh performance embedded mcroprocessors have made possble functonalty such as adaptve cruse control, lane departure warnng systems, ntegrated telematcs and satellte navgaton as well as advances n engne management, transmsson control and body electroncs. Where low-cost 8 and 16-bt mcroprocessors were prevously used as the bass for separate Electronc ontrol Unts (EUs), each supportng a sngle hard real-tme applcaton, there s now a trend towards ntegratng functonalty nto a smaller number of more powerful mcroprocessors. The motvaton for such ntegraton comes manly from cost reducton, but also offers the opportunty of functonalty enhancement. Ths trend n automotve electroncs s followng a smlar trend n avoncs. Integratng a number of real-tme applcatons onto a sngle mcroprocessor rases ssues of resource allocaton and parttonng. When composng a system, comprsng a number of applcatons, t s typcally a requrement to provde temporal solaton between the varous applcatons. Ths enables the propertes of prevous system desgns, where each applcaton resded on a separate processor, to be retaned. In partcular, f one applcaton fals to meet ts tme constrants, then deally there should be no knock on effects on other unrelated applcatons. There s currently consderable nterest n herarchcal schedulng as a way of provdng temporal solaton between applcatons executng on a sngle processor. In a herarchcal system, a global scheduler s used to determne whch applcaton should be allocated the processor at any gven tme, and a local scheduler s used to determne whch of the chosen applcaton s ready tasks should actually execute. A number of dfferent schedulng schemes have been proposed for both global and local schedulng. These nclude cyclc or tme slcng frameworks, dynamc prorty based schedulng, and fxed prorty schedulng. In ths paper we focus on the use of fxed prorty pre-emptve schedulng (FPPS) for both global and local schedulng. Fxed prorty pre-emptve schedulng offers advantages of flexblty over cyclc approaches whlst beng suffcently smple to mplement that t s possble to construct hghly effcent embedded real-tme operatng systems based on ths schedulng polcy. The basc framework for a system utlsng herarchcal fxed prorty pre-emptve schedulng s as follows: The system comprses a number of applcatons each of whch s composed of a set of tasks. A separate server s allocated to each applcaton. Each server has an executon capacty and a replenshment perod, enablng the overall processor capacty to be dvded up between the dfferent applcatons. Each server has a unque prorty that s used by the global scheduler to determne whch of the servers, wth capacty remanng and tasks ready to execute, should be allocated the processor. Further, each task has a unque prorty wthn ts applcaton. The local scheduler, wthn each server, uses task prortes to determne whch of an applcaton s ready tasks should execute when the server s actve. 1.1. Related work In 1999, buldng upon the work of Deng and Lu [2], Kuo and L [1] frst ntroduced analyss of herarchcal fxed prorty pre-emptve schedulng. They provded a smple utlsaton based schedulablty test, usng the technques of Lu and Layland [4]. In 2002, Saewong et al [5] provded response tme analyss for herarchcal systems usng Deferrable Servers or Sporadc Servers to schedule a set of hard real-tme applcatons. Ths analyss assumes that n the worst-case a server s capacty s made avalable at the end of ts perod. Whlst ths s a safe assumpton, t s

also pessmstc. In 2003, Shn and Lee [6] provded analyss of fxed prorty pre-emptve schedulng at the local level, gven the bounded delay perodc resource model, ntroduced by Feng and Mok [3]. Also n 2003, Lpar and Bn [7] provded an alternatve suffcent but not necessary response tme formulaton usng an avalablty functon to represent the tme made avalable by a server from an arbtrary tme orgn. Lpar and Bn [7] nvestgated the problem of server parameter selecton and consdered the choce of replenshment perod and capacty for a sngle server n solaton, usng a geometrc approach based on an approxmaton of the server avalablty functon. In [8], Almeda bult upon the work of Lpar and Bn, recognsng that the server avalablty functon depends on the maxmum jtter that perods of server avalablty may suffer. Ths analyss s more accurate but can stll be pessmstc. In 2005, Davs and Burns [13] provded exact 1 (suffcent and necessary) response tme analyss for ndependent hard real-tme tasks scheduled under Perodc, Sporadc and Deferrable Servers. In 2006, Davs and Burns [14] ntroduced and analysed the Herarchcal Stack Resource Polcy (HSRP) based on the Stack Resource Polcy of Baker [11]. Usng the HSRP bounds the delays due to mutually exclusve access to resources shared between dfferent applcatons. In ths paper, we nvestgate the problem of server parameter selecton, choosng the perod, capacty and prorty of a server assocated wth each applcaton. Unlke prevous work by Lpar and Bn [7], we consder server parameter selecton across multple servers wthn a system. Our research bulds upon prevous work on schedulablty analyss for herarchcal systems. In partcular, we nvestgate how mprovements n schedulablty that can be acheved by bndng tasks to a server of the approprate perod [13], mpact on the problem of server parameter selecton. 1.2. Organsaton Secton 2 descrbes the termnology, notaton and system model used n the rest of ths paper. It also recaptulates the schedulablty analyss for ndependent applcatons n herarchcal fxed prorty pre-emptve systems gven n [13]. Secton 3 dscusses server parameter selecton. Frst consderng how each of the three server parameters: capacty, perod, and prorty may be set f the other two are known; then dscussng the general problem of selectng the optmal server capacty, perod, and prorty when all three parameters are effectvely free varables. In Secton 4, we outlne an emprcal nvestgaton nto the problem of server parameter selecton, ncludng the reductons n server utlsaton that can be acheved by matchng server 1 Ths analyss s exact f and only f, n the best case, the server can provde all of ts capacty at the start of ts perod. perods to task perods, makng possble the bndng of tasks to the release of ther server. Secton 5 summarses the major contrbutons of the paper and suggests drectons for future research. 2. Herarchcal schedulng model 2.1. Termnology and system model We are nterested n the problem of schedulng multple real-tme applcatons on a sngle processor. Each applcaton comprses a number of real-tme tasks. Assocated wth each applcaton s a server. The applcaton tasks execute wthn the capacty of the assocated server. Schedulng takes place at two levels: global and local. The global schedulng polcy determnes whch server has access to the processor at any gven tme, whlst the local schedulng polcy determnes whch applcaton task that server should execute. In ths paper we analyse systems where the fxed prorty pre-emptve schedulng polcy s used for both global and local schedulng. Applcaton tasks may arrve ether perodcally at fxed ntervals of tme, or sporadcally after some mnmum nter-arrval tme has elapsed. Each applcaton task τ, has a unque prorty wthn ts applcaton and s charactersed by ts relatve deadlne D, worst-case executon tme, mnmum nter-arrval tme T, otherwse referred to as ts perod, and fnally ts release jtter J defned as the maxmum tme between the task arrvng and t beng ready to execute. Applcaton tasks are referred to as bound or unbound [15]. Bound tasks have a perod that s an exact multple of ther server s perod and arrval tmes that concde wth replenshment of the server s capacty. Thus bound tasks are only ever released at the same tme as ther server. All other tasks are referred to as unbound. Each server has a unque prorty S, wthn the set of servers and s charactersed by ts capacty S, and replenshment perod T S. A server s capacty s the maxmum amount of executon tme that may normally be consumed by the server n a sngle nvocaton. The replenshment perod s the maxmum tme before the server s capacty s avalable agan. A task s worst-case response tme R, s the longest tme from the task arrvng to t completng executon. Smlarly, a server s worst-case response tme R S, s the longest tme from the server beng replenshed to ts capacty beng exhausted, gven that there are tasks ready to use all of the server s avalable capacty. A task s sad to be schedulable f ts worst-case response tme does not exceed ts deadlne. A server s schedulable f ts worstcase response tme does not exceed ts perod. The analyss used n ths paper assumes that tasks have deadlnes that are no greater than ther perods, and that servers have deadlnes that are equal to ther perods. The crtcal nstant [4] for a task s defned as the pattern of executon of other tasks and servers that leads to the task s worst-case response tme.

The schedulablty analyss orgnally gven n [13] and revsted n the remander of ths secton assumes that all applcatons and tasks are ndependent. We note that ths restrcton can be lfted usng the analyss gven n [14]. In ths paper we consder applcatons scheduled under a smple Perodc Server. The analyss can be extended to alternatve server algorthms such as the Deferrable Server and the Sporadc Server, however due to space consderatons these alternatve server algorthms are not dscussed further. The Perodc Server s nvoked wth a fxed perod and executes any ready tasks untl ts capacty s exhausted. Note each applcaton s assumed to contan an dle task that contnuously carres out bult n tests, memory checks and so on, therefore the server s capacty s fully consumed durng each perod. Once the server s capacty s exhausted, the server suspends executon untl ts capacty s replenshed at the start of ts next perod. If a task arrves before the server s capacty has been exhausted then t wll be servced. Executon of the server may be delayed and or pre-empted by the executon of other servers at a hgher prorty. The jtter of the Perodc Server s assumed to be zero and for the sake of smplcty, server jtter s therefore omtted from the schedulablty analyss equatons. The behavour of the server does however add to the jtter of the tasks that t executes. The release jtter of the tasks s typcally ncreased by TS S, correspondng to the maxmum tme that a task may have to wat from the server capacty beng exhausted to t beng replenshed. The analyss presented n the next secton makes use of the concepts of busy perods and loads. For a partcular applcaton, a prorty level busy perod s defned as an nterval of tme durng whch there s outstandng task executon at prorty level or hgher. Busy perods may be represented as a functon of the outstandng executon tme at and above a gven prorty level, thus w (L) s used to represent a prorty level busy perod (or wndow, hence w) equvalent to the tme that the applcaton s server can take to execute a gven load L. The load on a server s tself a functon of the tme nterval consdered. We use L (w) to represent the total task executons, at prorty level and above, released by the applcaton wthn a tme wndow of length w. 2.2. Task schedulablty analyss In ths secton we revst the schedulablty analyss gven n [13] for ndependent hard real-tme applcatons. Usng the prncples of Response Tme Analyss [10], the worst-case response tme for a task τ, executng under a server S, occurs followng a crtcal nstant where: 1. The server s capacty s exhausted by lower prorty tasks as early n ts perod as possble. 2. Task τ and all hgher prorty tasks n the applcaton arrve just after the server s capacty s exhausted. 3. The server s capacty s replenshed at the start of each subsequent perod, however further executon of the server s delayed for as long as possble due to nterference from hgher prorty servers. The worst-case response tme of τ can be determned by computng the length of the prorty level busy perod startng at the frst release of the server that could execute the task (see Fgure 1). Ths busy perod can be vewed as beng made up of three components: 1. The executon of task τ and tasks of hgher prorty released durng the busy perod. 2. The gaps n any complete perods of the server. 3. Interference from hgher prorty servers n the fnal server perod that completes executon of the task. The task load at prorty level and hgher, ready to be executed n the busy perod w, s gven by: w + J j L w j j hp T j ( ) = + (1) ( ) where hp() s the set of tasks that have prortes hgher than taskτ and J j s the release jtter of the task, ncreased by T S S n the case of unbound tasks, due to the operaton of the server. Fgure 1 Busy perod The total length of gaps n complete server perods, not ncludng the fnal server perod, s gven by: L ( w ) 1 ( TS S ) (2) S The nterference due to hgher prorty servers executng durng the fnal server perod that completes executon of task τ s dependent on the amount of task executon that the server needs to complete before the end of the busy perod. The exact nterference can be calculated usng nformaton about server prortes, capactes and replenshment perods. Fgure 1 llustrates the nterference n the fnal server perod. The extent to whch the busy perod w extends nto the fnal server perod s gven by: L ( w ) w T 1 S (3) S The full extent of the busy perod, ncludng nterference from hgher prorty servers n the fnal server perod, can be found usng the recurrence relaton

from [13], gven by Equaton (4): n n n L w + 1 w L w ( ) = ( ) + T 1 ( S S S ) + n n L w w ( ) max 0, T S 1 (4) S X servers X hp ( S ) T X where hp(s) s the set of servers wth hgher prorty than server S. Recurrence starts wth a value of 0 w = + ( / S 1 )( TS S ) and ends ether when n+1 n n w = w n whch case w + J gves the task s worstcase response tme or when w > D J n+1 n whch case the task s not schedulable. Note the use of max(0, ) n the 3 rd term n Equaton (4) ensures that the extent to whch the busy perod extends nto the fnal server perod s not consdered to be an nterval of negatve length. 3. Server Parameter Selecton In ths secton, we consder the problem of server parameter selecton. The overall problem may be stated as follows: Gven a set of applcatons to be scheduled, wth each applcaton allocated a sngle server, what s the optmum set of server parameters (prorty, perod and capacty) that leads to a schedulable system whlst preservng the maxmum remanng processor utlsaton. X 1 (5) X servers TX We use remanng processor utlsaton as a metrc as ths provdes a broad measure of the processng tme that could potentally be made avalable to other applcatons that mght be added to the system. There are two sets of schedulablty constrants on any gven system. 1. The servers must have worst-case response tmes that do not exceed ther perods. (Each server S must guarantee to provde capacty S n each of ts perods T S ). 2. The tasks executed by the servers must have worst-case response tmes that do not exceed ther deadlnes. The problem of server parameter selecton can be generalzed further by permttng more than one server to be used to handle each applcaton (.e. statcally allocatng the tasks from a sngle applcaton to more than one server) ths s however beyond the scope of ths paper. 3.1. Determnng Server apactes In ths secton, we consder the sub-problem of determnng server capactes gven a known set of server prortes and perods. Gven these parameters, we can use the followng algorthm to derve the optmal set of server capactes for the set of server perods and prortes provded. OPTIMAL SERVER APAITY ALLOATION ALGORITHM for each server, hghest prorty frst bnary search between 0 and the server perod for the mnmum capacty Z that results n the server and ts tasks beng schedulable. f no schedulable capacty found ext system not schedulable else set the capacty of the server to Z Ths algorthm works because: 1. The capactes of lower prorty servers are not requred when determnng the schedulablty of a hgher prorty server or the tasks that t servces. 2. Any ncrease n the capacty of a hgher prorty server cannot decrease the response tme of a lower prorty server or the tasks t schedules. Hence ncreasng the capacty of a hgher prorty server beyond that determned by the above algorthm cannot lead to a lower prorty server requrng less capacty to schedule ts tasks. Thus the set of mnmum server capactes calculated n descendng prorty order are optmal for the gven set of server prortes and perods. 3.2. Determnng Server Prortes For a set of Perodc Servers, rate-monotonc prorty orderng (RMPO) [19] s the optmal prorty orderng wth respect to server schedulablty. However, when task schedulablty s consdered, RMPO s no longer optmal, as shown by the examples n Sectons 3.4 and 4.1. Smlarly, deadlne-monotonc prorty assgnment [20] based on the deadlne of the shortest deadlne task n each applcaton s not optmal ether. For the sub-problem where server perods and capactes are known then a feasble prorty orderng can be determned, f one exsts, usng a varaton on the Optmal Prorty Assgnment Algorthm devsed by Audsley [11]. The algorthm, gven below, works because: 1. The specfc prorty orderng of hgher prorty servers has no effect on the schedulablty of a lower prorty server or the tasks that t executes. 2. The parameters selected for a low prorty server have no bearng on the schedulablty of the hgher prorty servers or the tasks that they execute. The optmal server prorty assgnment algorthm requres n(n+1)/2 tests of server and assocated task schedulablty compared to the n! potental server prorty orderngs. Note, as the server perods and capactes are fxed n ths case, the remanng processor utlsaton does not

change wth dfferent prorty orderngs, nstead, the algorthm gven below s optmal n the sense that t always fnds a feasble prorty orderng f such a prorty orderng exsts. The nterested reader s drected to [11] for proof of why ths method s optmal, despte the fact that t makes a greedy allocaton, assgnng the frst unallocated yet schedulable server found to each prorty level. OPTIMAL SERVER PRIORITY ASSIGNMENT ALGORITHM for each prorty level, lowest frst for each unallocated server f the server and ts tasks are schedulable at ths prorty level allocate server to ths prorty break (contnue wth outer loop) return unschedulable return schedulable 3.3. Determnng Server Perods If the server prortes and capactes are fxed, then a set of server perods can be systematcally derved usng the algorthm gven below. OPTIMAL SERVER PERIOD ALLOATION ALGORITHM for each server, hghest prorty frst bnary search for the maxmum server perod Z that results n the server and ts tasks beng schedulable. f no schedulable perod found ext system not schedulable else set the perod of the server to Z Ths algorthm works because: 1. The parameters selected for a low prorty server have no bearng on the schedulablty of the hgher prorty servers or the tasks that they execute. 2. The nterference on lower prorty servers and the tasks they execute s monotoncally non-ncreasng wth respect to ncreases n the perod of each hgher prorty server. The optmal server perod allocaton algorthm gven above s optmal for the gven set of server prortes and capactes, n the sense that the servers wll have the mnmum total utlsaton and the system wll be schedulable wth ths set of server perods f t s schedulable for any selecton of server perods. 3.4. Overall parameter selecton Although t s possble to systematcally derve one of the server parameters (prorty, perod or capacty) f the other two are fxed, ths stll leaves the general problem of server parameter selecton. Our experments have shown that even f the problem s smplfed by fxng server prortes, t s stll dffcult to fnd the combnaton of server perods and capactes requred to acheve the mnmum total utlsaton. Ths s because the set of perod and capacty values for each server that result n the mnmum total utlsaton (global optma), do not necessarly correspond to those values that result n the mnmum utlsaton for any of the servers taken ndvdually (local optma). Ths can be seen n systems of just two servers. Typcally the perodcapacty par that results n the mnmum utlsaton for the hgher prorty server has a long perod and large capacty; however, as a consequence of the large capacty of the hgher prorty server, the perod of the lower prorty server has to be reduced, ncreasng ts overall utlsaton. In fact, the lower prorty server and ts tasks may smply be unschedulable due to the large amount of nterference from the hgher prorty server. Halvng the perod of the hgher prorty server ncreases ts utlsaton, as a result of overheads, but also typcally allows the lower prorty server to have a much longer perod for the same capacty. Although a shorter perod for the hgher prorty server results n a larger utlsaton for that server, ths can be more than compensated for by a reducton n utlsaton of the lower prorty server. Example: onsder two Perodc Servers S A and S B. Each server has a sngle (unbound) hard real-tme task to accommodate. The task parameters are gven n the table below: Table 1 Task T D Server τ 1 10 20 20 S A τ 2 4 24 24 S B Further, assume that server context swtch overheads 2 are 1 tme unt and that the processor needs to provde each nvocaton of a server wth ths context swtch tme before t can execute ts tasks. Now consder the choce of server perods, assumng that S A has the hgher prorty. The lowest utlsaton for S A occurs for a perod of 20 and a capacty of 11 (55% utlsaton). However, wth these parameters for S A there are no parameters for SB that result n a schedulable system. To accomodate task τ 2, the perod of S B s constraned accordng to: ( TB B ) + ntb + A + B D2 and so ( n + 1) TB 13 where n+1 s the number of nvocatons of SB that are used to servce task τ 2. Also for SB to be schedulable T B A + B. Thus possble perods for SB are constraned to le n the range 11 to 13 wth a maxmum possble capacty for SB of 2. None of these parameter selectons result n task τ 2 beng schedulable. 2 Such overheads are ncorporated n our analyss, by assumng that each server must utlse part of ts capacty for the context swtch to t, pror to executng any of ts tasks.

However f we choose T A = 10, A = 6 then S A has a utlsaton of 60% whch s 5% greater than before. However, SB s now just schedulable wth T B = 9, B = 3 (33.3% utlsaton). The overall server utlsaton s 93.3%. Note that the servers are n the reverse of ratemonotonc prorty order. 3.5. Greedy Algorthms In ths secton, we compare the performance of a greedy method of server parameter selecton wth that of optmal parameter selecton. The greedy algorthm proceeds as follows. For each server, hghest prorty frst: scan through the range of potental server perods. For each possble server perod, use a bnary search to determne the mnmum possble server capacty. Select the par of server parameters (perod and capacty) that provde the mnmum utlsaton for the server (local optma). Ths process s then repeated for each lower prorty server n turn. For comparson purposes an exhaustve search of possble server perod combnatons was used to determne the optmal selecton of perods and capactes. Ths was possble for smple systems comprsng just two applcatons. For each combnaton of server perods, the optmal server capactes were computed usng the algorthm descrbed n Secton 3.1. Ths method yelds the global optma. Our expermental nvestgaton nvolved generatng smulated systems comprsng two applcatons of 3 unbound tasks each wth overall task utlsaton levels of 40 to 85%. 100 systems were generated for each utlsaton level. For each system we then used the greedy and exhaustve (optmal) algorthms to select server perods and capactes. Note that the server prorty orderng was fxed and the use of Perodc Servers was assumed. Fgure 2 Fgure 2 shows the performance of the greedy algorthm n terms of the number of systems t was able to schedule compared to the optmal algorthm. At low system utlsatons, the greedy approach s able to fnd a schedulable set of server parameters however ts performance drops off sgnfcantly before that of the optmal algorthm. We also compared the number of solutons that the greedy algorthm produced that were wthn 1% of the optmal server utlsaton levels. It s apparent from the graph that even at relatvely low utlsaton levels, the greedy approach results n a large number of sub-optmal solutons. We would expect that the performance of the greedy approach to deterorate wth an ncreasng number of servers. As performance s relatvely poor even for two server systems, ths approach has lttle to recommend t. To summarse, n the general case, server parameter selecton does not appear to have an analytcal soluton. The best that we can acheve s to select server prortes and perods accordng to some search algorthm (potentally exhaustve search n the case of smple systems) and to derve the optmal set of server capactes va a bnary search usng the analyss presented n secton 3. It s clear that any approach to server parameter selecton based on determnng the best parameters for a sngle server n solaton s flawed. The parameters chosen for one server nfluence the choce of feasble parameters for others servers n such a way that choosng solutons that are locally optmal does not typcally lead to a globally optmal soluton. 4. Emprcal Investgaton In ths secton we present the results of emprcal nvestgatons nto the selecton of server parameters for smple systems. The am of these nvestgatons s to hghlght nterestng propertes of the server parameter selecton problem, whch may be useful n devsng solutons that are approprate for real systems. The algorthms and technques that we use n our nvestgaton, such as exhaustve search, are not ntended as solutons to the general problem, they are merely tools wth whch to mprove our understandng. We therefore gve no analyss of the complexty or executon tme of these methods. Smlarly, the tasksets used n the experments detaled here are not meant to reflect the sets of tasks found n real applcatons; nstead, smple tasksets were used so that we could reason about the propertes that they have n common wth real systems, such as harmonc / non-harmonc task perods, and perods that are multples of the server perod. Wth systems comprsng just two Perodc Servers, t s possble to exhaustvely evaluate all possble combnatons of server perods. In ths expermental nvestgaton, we used a bnary search and the algorthm presented n secton 3.1, to determne the mnmum capacty for each Perodc Server, for every possble combnaton of server perods. The results of the experments are presented as 3-D graphs of the remanng processor utlsaton: X 1 X servers TX The remanng utlsaton (z-axs) s plotted aganst the perod of the lower prorty server (x-axs) and the

perod of the hgher prorty server (y-axs). The remanng utlsaton surface s colour coded accordng to ts value. Peaks n the surface represent the best choces of server perods. Although t s possble to understand and nterpret the fgures n ths secton when they are vewed n black and whte on a prnted copy, the fgures are clearer when dsplayed n colour. It s therefore suggested that readers vew ths paper onlne; the fgures wll then appear n colour. 4.1. Experment 1 In ths experment, we used a smple taskset comprsng the three tasks gven n Table 2 below. Table 2 Prorty Exec. Tme Perod Deadlne 1 5 50 50 2 7 125 125 3 6 300 300 Each server was requred to execute a copy of ths taskset, thus makng the server prorty orderng rrelevant. A server context swtch overhead of 2 tme unts was assumed. Fgure 3 llustrates the remanng processor utlsaton for all combnatons of low prorty (LP) and hgh prorty (HP) server perods n the range 4-100. In ths case, all the tasks were consdered to be unbound, rrespectve of whether ther perods were a multple of the server s perod. server perods that are fractons of the task perods. For example: 1/6, 1/5, 1/4, 1/3, 1/2. A number of nterestng features are vsble n the graph. In the regon ndcated by label A, the low prorty server s perod exceeds that of the hghest prorty task t must execute, ths results n the server s capacty ncreasng wth each ncrease n ts perod, leadng to a sgnfcant tal off n the remanng processor utlsaton. In the regon ndcated by label B, long hgh prorty server perods and the resultant large capacty of that server result n the low prorty server beng unschedulable wth relatvely short perods. The optmal selecton of server perods ( THP = 50 and T LP = 43 ) gves a maxmum remanng utlsaton of 52.4%. Note ths optmum selecton of parameters has the servers n the opposte of rate-monotonc prorty orderng. Ths s a clear example of the fact that although the optmum prorty orderng for Perodc Servers s rate-monotonc when only server schedulablty s consdered, ths s not the case when task schedulablty s also a factor. Fgure 3 The graph shows a jagged landscape of remanng utlsaton, dependent on the relatonshp between the server perods and those of the tasks. The peaks n remanng utlsaton are closer together at shorter server perods. Ths s because the peaks relate to values of the Fgure 4 Fgure 4 shows a very smlar graph to Fgure 3; however, ths tme whenever a server s perod s an exact dvsor of the perod of a task, that task s bound to the server. Ths results n two ncreased rdges wth respect to treatng the tasks as always beng unbound. These rdges occur for low prorty server perods of 25 and 50. omparng Fgure 3 and Fgure 4 shows that allowng tasks to be bound to the release of ther server results n a change n the optmal server parameters. Wth bound tasks, the maxmum remanng utlsaton of 54% occurs when both servers have a perod of 50, whch s a harmonc of two of the task perods (50 and 300). It s nterestng to note that there are no addtonal

rdges correspondng to partcular values of the hgh prorty server perod, despte the fact that ths server executes an dentcal taskset. The reason for ths s that n the case of the hghest prorty server only, f a task s deadlne s equal to ts perod and s also an exact multple of the server s perod, then the amount of executon tme that a server of a gven capacty can make avalable to the task s the same rrespectve of whether the task s bound to the release of the server or not. As the task s perod s an exact multple n of the server s perod, then n both bound and unbound cases, the server can make exactly n tmes ts capacty avalable by the task s deadlne (whch s also equal to n tmes the server s perod), hence there s no observable advantage n tasks beng bound to the hgh prorty server n ths case. 4.2. Experment 2 In ths experment we used a smple taskset comprsng the four tasks gven n Table 3 below. Each server was requred to execute a copy of ths taskset, makng the server prorty orderng rrelevant. Agan a server context swtch overhead of 2 tme unts was assumed. Table 3 Prorty Exec. T me Perod Deadlne 1 8 160 100 2 12 240 200 3 16 320 300 4 24 480 400 In ths case, the task perods and deadlnes were chosen to emphasze the effect of havng tasks bound to the release of the server. The task perods were chosen such that they would be harmoncs of a number of dfferent server perods. Further, the task deadlnes were chosen to be strctly less than the correspondng task perods as ths also enhances the dfference between the server capacty requred f tasks are treated as bound versus unbound. It should however be noted that ths taskset s a reasonable one: there are many real world systems that have such harmonc relatonshps between ther task perods. Fgure 5 llustrates the remanng processor utlsaton for varous server perods for the taskset n Table 3. In ths case, all the tasks were assumed to be unbound. The optmal selecton of server perods ( THP = 64 and T LP = 100 ) gves a maxmum remanng utlsaton of 42.875%. By comparson, Fgure 6 llustrates the remanng utlsaton for varous server perods when tasks can potentally be bound to the servers. A task s treated as beng bound to ts server f the task s perod s an exact multple of the server s perod. Note that Fgure 6 shows only data for those server perods that result n one or more bound tasks and where the resultant remanng utlsaton s hgher than t would otherwse be f all the tasks were treated as beng unbound. Ths makes t easy to see the advantage of bndng tasks to the servers. Fgure 5 Fgure 6 There are a large number of possble server perods that the task perods are harmoncs of. The harmonc perods that provde an advantage n terms of reduced server capacty are 16, 20, 32, 40, 48, 60, 64, 80, 96 and 160 n the case of the low prorty server and 48, 60, 96, 120 and 160 for the hgh prorty server. The optmal selecton of server perods ( THP = 160 and T LP = 160 ) gves a maxmum remanng utlsaton of 51.25%. Ths s a sgnfcant ncrease n remanng utlsaton compared wth treatng all the tasks as unbound (42.875%).

Recall that task deadlnes were less than perods for the taskset used n ths experment. Ths hghlghts the dfference between the analyss of bound and unbound tasks. If a task s unbound, then for server perods greater than the task s deadlne, the server s capacty has to ncrease sgnfcantly to ensure that the task s schedulable, resultng n a marked reducton n remanng utlsaton. Ths s not the case when a task s bound to the server, wth both task and server sharng the same perod, a short deadlne task may be schedulable for a small server capacty. Permttng tasks to be bound to ther server results n solutons that are very dfferent, n terms of server utlsaton, from those that are avalable when all the tasks are unbound. It s nterestng to note that the optmum selecton of server perods occurs as a spke n the remanng utlsaton surface. Ths has mplcatons for search technques amed at determnng the optmal selecton of server parameters. Gven such a dscontnuous landscape, a general-purpose search technque such as smulated annealng or genetc algorthms may not be effectve wthout the use of heurstcs to locate potental good solutons based on harmoncs. 4.3. Addtonal Experments We performed a number of addtonal experments smlar to those descrbed earler. The basc trends vsble n these experments were as follow: Number of tasks: Increasng the number of tasks n an applcaton (or more correctly ncreasng the number of dstnct task perods) results n a change n the topology of the remanng utlsaton landscape. More tasks mply an ncreased number of valleys each wth less depth. Wth 10 or more tasks wth co-prme perods precse choce of server perod becomes less mportant. In ths case there s a regon of values that gve smlar levels of remanng utlsaton. Harmonc task perods: If a perod can be chosen for the server that exactly dvdes a number of task perods and those tasks can be bound to the server then a sgnfcant ncrease n remanng utlsaton can be acheved. Deadlne less than perod: Bndng tasks to a server appears to have the bggest mpact when the shortest deadlne task s bound to the server. Ths s because the range of values possble for the server s perod s effectvely constraned to less than the shortest task deadlne n the case of unbound tasks and to less than the shortest task perod n the case of bound tasks. Permttng a greater useful range of server perods typcally results n better solutons as longer server perods lead to lower overheads. 5. Summary and conclusons In ths paper we nvestgated the problem of selectng approprate server parameters for a sngle processor system, runnng multple applcatons usng herarchcal fxed prorty pre-emptve schedulng. The motvaton for ths work comes from the automotve, avoncs and other ndustres where the advent of hgh performance mcroprocessors s now makng t both possble and cost effectve to mplement multple applcatons on a sngle platform. 5.1. ontrbuton The major contrbutons of ths work are as follows: Provdng a set of algorthms that determne the optmal value for one server parameter (capacty, perod, or prorty) when the other two parameters are fxed. Showng that n general server parameter selecton s a holstc problem. It s not suffcent to determne the optmal set of server parameters for each server n solaton as these parameters have an effect on the choce of possble values for other servers. Dervng local optma (for each server) does not lead to the globally optmal soluton. Showng that whlst Rate Monotonc Prorty Assgnment (RMPO) s the optmal prorty assgnment polcy for Perodc Servers when only server schedulablty s consdered, ths s no longer the case when the schedulablty of tasks executed by the server s also taken nto account. Illustratng the ncrease n remanng utlsaton (spare capacty) that can be acheved by choosng server perods that are exact dvsors of ther task perods. Ths enables tasks to be bound to the release of ther server, greatly enhancng task schedulablty. 5.2. Future work Today t s possble usng the analyss technques descrbed n ths paper to determne the optmal set of server parameters va an exhaustve search of possble perods and prortes for smple systems comprsng 3 or 4 applcatons. Further work s requred to provde an effectve algorthm capable of choosng an optmal or close to optmal set of server parameters gven systems comprsng ten or more applcatons. A global optmsaton technque such as smulated annealng or genetc algorthms could possbly be used as the hgh-level search method, wth selecton of locally optmal server capactes va a bnary search. It should be noted however that the spky topography of the remanng utlsaton surface makes effectve search dffcult. As an alternatve approach, the use of heurstcs, such as checkng all possble combnatons of harmoncs, may be effectve n some cases. Another nterestng area of future research nvolves ncorporatng Qualty of Servce (QoS) requrements nto herarchcal fxed prorty pre-emptve systems. Here addtonal servers could be deployed at both levels n the herarchy to make spare capacty avalable responsvely. An nterestng alternatve would be to use Dual Prorty Schedulng [17] as the polcy of choce at both global

and local schedulng levels. 6. Acknowledgements Ths work was partally funded by the EU funded FRESOR project. 7. References [18] L. Sha, R. Rajkumar, J.P. Lehoczky. Prorty nhertance protocols: An approach to real-tme synchronzaton. IEEE Transactons on omputers, 39(9): 1175-1185, 1990. [19].L. Lu, J.W. Layland. "Schedulng Algorthms for Multprogrammng n a Hard-Real-tme Envronment", Journal of the AM, 20(1): 46-61, January 1973. [20] J.Y.-T. Leung, J. Whtehead, "On the omplexty of Fxed-Prorty Schedulng of Perodc Real-tme Tasks". Performance Evaluaton, 2(4): 237-250, December 1982. [1] T-W. Kuo, -H. L. A Fxed Prorty Drven Open Envronment for Real-Tme Applcatons. In proceedngs of IEEE Real-Tme Systems Symposum, pp. 256-267, IEEE omputer Socety Press, December 1999. [2] Z. Deng, J.W-S. Lu. Schedulng Real-Tme Applcatons n an Open Envronment. In proceedngs of the IEEE Real-Tme Systems Symposum. pp. 308-319, IEEE omputer Socety Press, December 1997. [3] X. Feng, A. Mok. A Model of Herarchcal Real-Tme Vrtual Resources. In proceedngs of IEEE Real-Tme Systems Symposum. pp. 26-35, IEEE omputer Socety Press, December 2002. [4].L. Lu, J.W. Layland, Schedulng Algorthms for Multprogrammng n a Hard Real-Tme Envronment JAM, 20 (1) 46-61, January 1973. [5] S. Saewong, R. Rajkumar, J. Lehoczky, M. Klen. Analyss of Herarchcal Fxed prorty Schedulng. In proceedngs of the ERTS, pp. 173-181, 2002. [6] I. Shn, I. Lee. Perodc Resource Model for ompostonal Real-Tme Guarantees. In proceedngs of the IEEE Real-Tme Systems Symposum. pp. 2-13, IEEE omputer Socety Press, December 2003. [7] G. Lpar, E. Bn. Resource Parttonng among Real-Tme Applcatons. In proceedngs of the ERTS, pp July 2003. [8] L. Almeda. Response Tme Analyss and Server Desgn for Herarchcal Schedulng. In proceedngs of the IEEE Real-Tme Systems Symposum Work-n-Progress, December 2003. [9] G. Bernat, A. Burns. New Results on Fxed Prorty Aperodc Servers. In proceedngs of the IEEE Real-Tme Systems Symposum, pp. 68-78, IEEE omputer Socety Press, December 1999. [10] N.. Audsley, A. Burns, M. Rchardson, A.J.Wellngs. Applyng new Schedulng Theory to Statc Prorty Pre-emptve Schedulng. Software Engneerng Journal, 8(5) pp. 284-292, 1993. [11] T.P. Baker. Stack-based Schedulng of Real-Tme Processes. Real-Tme Systems Journal (3)1, pp. 67-100, 1991. [12] L. Sha, J.P. Lehoczky, R. Rajkumar. Solutons for some Practcal Problems n Prortsed Preemptve Schedulng In proceedngs of the IEEE Real-Tme Systems Symposum, pp. 181-191, IEEE omputer Socety Press, December 1986. [13] R.I. Davs, A. Burns Herarchcal Fxed Prorty Pre-emptve Schedulng In proceedngs of the IEEE Real-Tme Systems Symposum, pp. 389-398, IEEE omputer Socety Press, December 2005. [14] R.I. Davs, A. Burns Resource Sharng n Herarchcal Fxed Prorty Pre-emptve Systems In proceedngs of the IEEE Real- Tme Systems Symposum, pp. 257-268, IEEE omputer Socety Press, December 2006. [15] EU Informaton Socety Technologes (IST) Program, Flexble Integrated Real-Tme Systems Technology (FIRST) Project, IST- 2001-34140. [16] M. accamo, L. Sha. Aperodc Servers wth Resource onstrants In proceedngs of the IEEE Real-Tme Systems Symposum. pp. 161-170, IEEE omputer Socety Press, December 2001. [17] G. Lamastra, G. Lpar, L. Aben. A Bandwdth Inhertance Algorthm for Real-Tme Task Synchronsaton n Open Systems In proceedngs of the IEEE Real-Tme Systems Symposum, pp. 151-160, IEEE omputer Socety Press, December 2001.