174: Scheduling Systems. Emil Michta University of Zielona Gora, Zielona Gora, Poland 1 TIMING ANALYSIS IN NETWORKED MEASUREMENT CONTROL SYSTEMS



Similar documents
4. Fixed-Priority Scheduling

Real-Time Scheduling (Part 1) (Working Draft) Real-Time System Example

Lecture 3 Theoretical Foundations of RTOS

HARD REAL-TIME SCHEDULING: THE DEADLINE-MONOTONIC APPROACH 1. Department of Computer Science, University of York, York, YO1 5DD, England.

Predictable response times in event-driven real-time systems

Real-Time Software. Basic Scheduling and Response-Time Analysis. René Rydhof Hansen. 21. september 2010

Scheduling Imprecise Tasks in Real-Time Distributed Systems

Real- Time Scheduling

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Periodic Task Scheduling

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

The simple case: Cyclic execution

Improved Handling of Soft Aperiodic Tasks in Offline Scheduled Real-Time Systems using Total Bandwidth Server

3. Scheduling issues. Common approaches /1. Common approaches /2. Common approaches / /13 UniPD / T. Vardanega 23/01/2013. Real-Time Systems 1

Aperiodic Task Scheduling

Partition Scheduling in APEX Runtime Environment for Embedded Avionics Software

Sustainability in Real-time Scheduling

Real Time Scheduling Basic Concepts. Radek Pelánek

Effective Scheduling Algorithm and Scheduler Implementation for use with Time-Triggered Co-operative Architecture

SOFTWARE VERIFICATION RESEARCH CENTRE THE UNIVERSITY OF QUEENSLAND. Queensland 4072 Australia TECHNICAL REPORT. No Real-Time Scheduling Theory

CPU Scheduling. CPU Scheduling

Common Approaches to Real-Time Scheduling

Scheduling Real-time Tasks: Algorithms and Complexity

Operating System Aspects. Real-Time Systems. Resource Management Tasks

Aperiodic Task Scheduling

Lec. 7: Real-Time Scheduling

How To Compare Real Time Scheduling To A Scheduled Scheduler On Linux On A Computer System With A Visualization System

Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2

Priority-Driven Scheduling

Predictable response times in eventdriven real-time systems

Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings

Allocating Hard Real Time Tasks (An NP-Hard Problem Made Easy)

Scheduling Sporadic Tasks with Shared Resources in Hard-Real-Time Systems

Real-Time Systems Hermann Härtig Real-Time Communication (following Kopetz, Liu, Schönberg, Löser)

N. Audsley. A. Burns Department of Computer Science, University of York, UK. ABSTRACT

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

AN APPROPRIATE ENGINEERING APPROACH

Efficient Scheduling of Sporadic, Aperiodic, and Periodic Tasks with Complex Constraints

Latency on a Switched Ethernet Network

In Proceedings of the First IEEE Workshop on Real-Time Applications, New York, NY, May 1993.

Hard Real-Time Reconfiguration Port Scheduling

Real-time scheduling algorithms, task visualization

LAB 5: Scheduling Algorithms for Embedded Systems

AN OVERVIEW OF QUALITY OF SERVICE COMPUTER NETWORK

DYNAMIC SCHEDULING STRATEGIES FOR AVIONICS MISSION COMPUTING. David L. Levine, Christopher D. Gill, and Douglas C. Schmidt

A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis

Compositional Real-Time Scheduling Framework with Periodic Model

Commonly Used Approaches to Real-Time Scheduling

CPU Scheduling. Multitasking operating systems come in two flavours: cooperative multitasking and preemptive multitasking.

!! #!! %! #! & ((() +, %,. /000 1 (( / 2 (( 3 45 (

REAL TIME OPERATING SYSTEMS. Lesson-18:

6.6 Scheduling and Policing Mechanisms

Exercises : Real-time Scheduling analysis

Scheduling Aperiodic and Sporadic Jobs in Priority- Driven Systems

TIME PREDICTABLE CPU AND DMA SHARED MEMORY ACCESS

Real-Time Scheduling 1 / 39

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

ICS Principles of Operating Systems

Integrating job parallelism in real-time scheduling theory

An Efficient Non-Preemptive Real-Time Scheduling

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Schedulability analysis of distributed real-time systems

Resource Synchronization in Hierarchically Scheduled Real-Time Systems using Preemptive Critical Sections

On-line Scheduling of Real-time Services for Cloud Computing

Experimental implementation of a real-time token-based network protocol on a microcontroller

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

On-line scheduling algorithm for real-time multiprocessor systems with ACO

Efficient Scheduling Of On-line Services in Cloud Computing Based on Task Migration

MANY complex distributed embedded systems with time

Hierarchical Real-Time Scheduling and Synchronization

Performance of Algorithms for Scheduling Real-Time Systems with Overrun and Overload

Advanced Operating Systems (M) Dr Colin Perkins School of Computing Science University of Glasgow

Real Time Database Systems

CHAPTER 4: SOFTWARE PART OF RTOS, THE SCHEDULER

Real-Time (Paradigms) (51)

Chapter 3 ATM and Multimedia Traffic

A SIX-LEGGED ROBOT: REAL-TIME ISSUES AND ARCHITECTURE. Mauro Marinoni, Alessio Carlini, Giorgio Buttazzo

Chapter 5 Process Scheduling

Task Priority Optimization in Real-Time Multi-Core Embedded Systems

Using semantic properties for real time scheduling

Software Engineering for Real- Time Systems.

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

ECE 358: Computer Networks. Solutions to Homework #4. Chapter 4 - The Network Layer

A Discrete Event Model for Real Time System Simulation

Methods and Tools For Embedded Distributed System Scheduling and Schedulability Analysis

Providing Deterministic Quality-of-Service Guarantees on WDM Optical Networks

Multi-core real-time scheduling

Resource Reservation & Resource Servers. Problems to solve

Research Article Average Bandwidth Allocation Model of WFQ

Mixed-Criticality Systems Based on Time- Triggered Ethernet with Multiple Ring Topologies. University of Siegen Mohammed Abuteir, Roman Obermaisser

Quality of Service versus Fairness. Inelastic Applications. QoS Analogy: Surface Mail. How to Provide QoS?

Earliest Due Date (EDD) [Ferrari] Delay EDD. Jitter EDD

The Design and Implementation of Real-Time Schedulers in RED-Linux

Comparison of FlexRay and CAN-bus for Real-Time Communication

CS640: Introduction to Computer Networks. Why a New Service Model? Utility curve Elastic traffic. Aditya Akella. Lecture 20 QoS

Remote I/O Network Determinism

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner

MultiPARTES. Virtualization on Heterogeneous Multicore Platforms. 2012/7/18 Slides by TU Wien, UPV, fentiss, UPM

Global Multiprocessor Real-Time Scheduling as a Constraint Satisfaction Problem

Transcription:

174: Scheduling Systems Emil Michta University of Zielona Gora, Zielona Gora, Poland 1 Timing Analysis in Networked Measurement Control Systems 1 2 Introduction to Scheduling Systems 2 3 Scheduling Theory 2 4 Functional Model of NMCS 4 5 Tasks Modeling 5 6 Scheduling Tasks on Node 6 7 Scheduling Messages Across a Network 7 8 Trends 7 Related Articles 8 References 8 1 TIMING ANALYSIS IN NETWORKED MEASUREMENT CONTROL SYSTEMS NMCS (networked measurement control systems) are widely used in applications ranging from difficult process control to simple discrete manufacturing. Usually, these systems impose real-time requirements on the nodes and communication networks (Kopetz, 1997; Sha and Sathaye, 1995). Stankovic (1988) defines realtime computing systems as those systems in which the correctness of the system depends not only on the logical result of computation but also on the time at which the results are produced. There are many examples of real-time computing systems, such as control systems, flight control systems, and robotics. A typical real-time computing system has a real-time program running in the system, which reads inputs from input devices, processes these inputs, and produces outputs to be sent to output devices see also Article 78, Embedded Systems, Volume 1. The time between the arrival of an input from a device and the completion of the processing for that input is called the response time forthe device (JosephandPandya, 1986). The relative deadline for the device can be defined as the maximum interval between the instant of the input arrival and the completion of the processing for that input. The required response time for a device must be smaller or equal to its relative deadline. In NMCS, the relative deadline is often assumed to be equal to the period. The task deadline value is set by object requirements but the value of the worst-case response time is a result of simulation methods or analytical techniques used to do the timing analysis. It is assumed that each input and output device is assigned a task of the application program and that the tasks share the same processor. The problem of determining whether the processor will meet its peak-processing load becomes one of schedulability analysis of tasks in NMCS (Burns, 1991). If the input (sensor node) and output (actuator node) devices are network components, then the input device processes events and generates messages to the output device. The problem of determining whether the communication system will meet its peak load is one of schedulability analysis of tasks. Consideration of priority levels is crucial to a real-time system. If different inputs have different response time requirements, we need to consider different priority levels to schedule the related processing tasks. The problem is to determine whether for a given assignment of priority levels, the system will meet its peak load see also Article 165, Reproduced from the Handbook of Measuring System Design John Wiley & Sons, Ltd, 2005.

2 Elements: E Communication in Measuring Systems Introduction to Networked Instrumentation, Volume 1 and Article 166, Instrument Interconnection, Volume 1. Schedulability analysis 2 INTRODUCTION TO SCHEDULING SYSTEMS Offline Online Developers and integrators of NMCS face the challenge of meeting end-to-end real-time requirements. This requires techniques to ensure timing correctness both in embedded nodes and in the communication network. Schedulability analysis can be applied to prove that time requirements are satisfied. Scheduling is defined as a resource (processor, network) allocation required to task (program, message) execution and its termination in the required time. The general problems are to find a sequence in which tasks pass between the resources, that there is a feasible schedule, and that it is optimal with respect to some decided economic and/or performance criterion. Reliable timing behavior is crucial in NMCS with realtime requirements. In many cases, designers and/or developers have had to rely on testing to establish timing reliability. Using suitable scheduling methods, system developers can verify timing behavior at the design stage and implement the required timing behavior into the application right from the start. Scheduling allows estimate resource utilization and establishes relationships between the task s worst-case response times and their deadlines. It determines whether a designed system is schedulable and indicates the margin by which a deadline is met or might be missed. A large number of approaches to modeling and solving scheduling problems have been reported in the literature for this topic. This article focuses on the static approach because this methodology best fits the NMCS. Scheduling theory provides a well-founded way of predicting whether a designed system having real-time requirements will meet their deadlines or not. 3 SCHEDULING THEORY 3.1 Classification The schedulability analysis can be performed online or offline as it is shown in Figure 1. In the online case, the schedulability of the task set is analyzed at run time, whereas in the offline case, it is performed prior to run time. Offline scheduling requires little run-time overhead and the schedulability of the task set is guaranteed before execution. However, it requires prior knowledge of the tasks timing characteristics. If the tasks characteristics are not Table-driven scheduler Priority-based scheduler Fixed priority assignment Planing-based scheduler Dynamic priority assignment Figure 1. Basic types of schedulability analysis. Best-effort scheduler known prior to the run time, schedulability analysis must be performed online. Ramamritham and Stankovic (1994) distinguish two basic types of online schedulers: planning-based and besteffort schedulers. In the planning-based type, when a new task arrives, the scheduler tries to redefine a new schedule, which is able to comply with both the requirements of the new task and the requirements of the previously scheduled tasks. The new task is only accepted for execution if the schedule is found feasible. In the best-effort type, when a new task arrives, the scheduler does not try to perform a new schedule. The new task is accepted for execution; the system tries to do its best to meet deadlines. Offline scheduling paradigms depending on whether the schedulability analysis produces a schedule according to which tasks are dispatched at run time. The table-driven approach is the best-known example of an offline scheduling that produces a schedule. The priority-based approach is an example of offline scheduling where no explicit schedule is constructed. At run time, tasks are executed in a highest-priority-first basis. Priority-based approaches are much more flexible and accommodating than table-driven approaches. 3.2 Priority assignment schemes The most used priority assignment scheme is to give the tasks a priority level based on its period: the smaller the period, the higher the priority. Thus, if they have smaller periods, their worst-case response time must also be smaller. This type of priority assignment is known as the RM (rate monotonic assignment).

Scheduling Systems 3 RM scheduling theory ensures that, for a given fixed set of tasks with fixed and known priority ordering, as long as the system utilization of all tasks lies below a certain bound and appropriate scheduling algorithms are used, all tasks meet their deadlines. This puts the development and maintenance of real-time systems on an analytical basis, making these systems easier to develop and maintain. RM theory was introduced by Liu and Layland (1973) for scheduling independent, periodic tasks with end-of-period deadlines. RM is an optimal static priority scheduling algorithm for independent periodic tasks with end-of-period deadlines. If some of the tasks are sporadic, it may not be reasonable to consider the relative deadline equal to the period. A different priority assignment can then be to give the tasks a priority level based on its relative deadline: the smaller the relative deadline, the higher the priority. This type of priority assignment is known as the DM (deadline monotonic) assignment (Leung and Whitehead, 1982). In both RM and DM priority assignments, priorities are fixed, in the sense that they do not vary along time. At run time highest priority tasks are dispatched first. A similar dispatching policy can be used if the task, which is chosen to run, is the one with the earliest deadline. This also corresponds to a priority-driven scheduling, where the priorities of the tasks vary with time. Thus, the EDF (earliest deadline first) method is a dynamic priority assignment scheme. Pre-run time schedulability analysis of tasks dispatched according to the EDF assignment scheme was introduced by Liu and Layland (1973). In all three cases, the dispatching phase will take place either when a new task is released or when the execution of the running task ends. 3.3 Preemptive and non-preemptive systems A common implementation for embedded node software and for a Master/Slave communication system is to use a static cyclic system. This involves the static creation of the schedule that typically consists of a number of tasks running one after another to form an overall schedule. The cyclic system does not make effective use of the CPU and worst-case response time for each task exceeds its period. In a cyclic system, all tasks must run at harmonic processing rates. Such a solution can be used for nodes with a small number of tasks and for implementations without real-time requirements. To improve effective use of the node CPU, and to optimize worst-case response time, a task s priority levels with preemptive or non-preemptive scheduling policy can be used. In a priority-based scheduler, a higher-priority task may be released during the execution of a lower-priority one. If the tasks are being executed in a preemptive context, the higher-priority task will preempt the lower-priority one. In a non-preemptive context, the lower-priority task will be allowed to complete its execution before the higherpriority task starts execution. This situation can be described as a priority inversion because a lower-priority task delays a higher-priority task. 3.4 Offline schedulability analysis There are two basic types of analytical methods to perform pre-run time schedulability analysis. One is based on the analysis of the processor or network utilization. The other is based on the response time analysis for each individual task. In Liu and Layland (1973), the authors demonstrated that by considering only the processor or network utilization of task set, a test for pre-run time schedulability analysis could be obtained. An analytical approach is used to predict the worstcase response time for each task. The obtained values are then compared with the relative deadlines of the tasks. Lechoczky (1990) and Audsley et al. (1993) improved the schedulability analysis introduced by Liu and Layland (1973). The utilization-based test needs a simple computation procedure, which is applied to the overall task set. For this reason, they are very useful for implementing schedulers that check the feasibility online. However, utilization-based tests do not give task s response time values. It constitutes sufficient, but not necessary, conditions. For more complicated task models, the utilization-based tests cannot be used, see Tindell (1992). 3.5 Basic utilization-based test For the RM priority assignment, Liu and Layland (1973) proved that a set of N independent periodic tasks characterized by a worst-case computation time C and a period T scheduled by the rate monotonic algorithm will always meet their deadlines for all tasks, if a utilization-based pre-run time schedulability test is following. U = N i=1 C i N (2 1/N 1) (1) where: C i is the worst-case computation time of task τ i,and is the minimum time between task τ i releases (period).

4 Elements: E Communication in Measuring Systems Utilization-based tests are sufficient but not necessary conditions. This utilization-based test is valid for periodic independent tasks having relative deadlines equal to the period and for preemptive systems. For the non-preemptive case Sha, Klein and Goodenough (1991) shows that similar analysis can be adapted to include task τ i blocking time B i, during which high priority tasks are blocked by low-priority tasks: U = i i=1 ( Ci ) + B i i (2 1/i 1), i,1 i N (2) where B i is the maximum, blocking a task τ i by lowerpriority tasks than task τ i. 3.6 Response time tests The task response time test, for determining the interval between its minimum and worst-case values, is a very important time parameter to determine in difficult and safety-critical real-time projects. To confirm that each task meets its deadline, the worstcase completion time of each task is calculated taking into account the influence of the other tasks. It was proven by Joseph and Pandya (1986) that the worst-case response time R i,oftaskτ i is found when all tasks are synchronously released at their maximum rate. For that instance, R i can be computed using the following recursive equation: R n+1 i = j hp(i) ( ) R n i C j + C i (3) where hp(i) denotes the set of tasks of higher priority than task i priority. The symbol is the ceiling function: it is a roundup function. T j Consider the initial value for R i is zero. Recursion ends when R n+1 = R n = R i. If the worst-case response time R i exceeds T t (in the case of RM priority assignment) or D i, (in the case of DM priority assignment) the task τ i is not schedulable. This result is valid in the preemptive context. For the case of non-preemptive tasks, the utilizationbased test using (3) was updated by Sha, Klein and Goodenough (1991) to include a blocking factor, during which higher-priority tasks can be blocked by low-priority tasks. Taking into account the blocking factor B i the worst-case response time for non-preemptive approach can be derived from the following recursive equation: = B i + ( ) R n i C j + C i (4) R n+1 i j hp(i) where B i = max C j for lp(i), lp(i) denotes tasks with lower priority than task τ i. 4 FUNCTIONAL MODEL OF NMCS An NMCS is implemented by a set of embedded nodes. Each node runs a number of tasks. These tasks communicate with each other by passing messages between nodes across the shared network. In order to meet the timing requirements, the end-to-end communication delay, composed of sender node generation delay, queuing delay during accessing network, transmission delay, and delivery delay in receiver node, must be bounded. Now consider the techniques that can be applied both to software within nodes, and to messages passing on shared buses, to determine that deadlines will be met. To analyze the time constraint of a networked, distributed system, we can distinguish three functional layers: node application layer, communication stack layer and network layer shown in Figure 2 (Michta, 2002). T j Node 1 Application Communication stack Node N Application Communication stack SC, RM, DM, EDF preemptive, non-preemptive RM, DM, EDF preemptive, non-preemptive RM, DM, non-preemptive Network Figure 2. Functional model of NMCS and scheduling approaches.

Scheduling Systems 5 During analysis of each layer, a combination of different scheduling policies can be used. For example, the network layer may be priority driven with use of nonpreemptive RM or DM polices: nodes may be priority or time driven with use in both preemptive and nonpreemptive approaches. Different nodes may have different scheduling policies due to manufacturer s preferences; thus, during the NMCS designing phase, there exist many influences on the choice of a communication system. RM, DM, and EDF are a priority-based scheduling algorithm, so the system must have an adequate number of priority levels that can be assigned to tasks on each layer. The primary objective during designing phase is to decouple the scheduling of resources and analyze the scheduling of each node processor and each network. As we can see in Figure 2, the same techniques of analysis for task scheduling on the processor node and message scheduling across the network can be used. Decoupling resources allow us to separate the scheduling problems and simplify the development and maintenance of nodes and NMCS. 5 TASKS MODELING Consider the simple NMCS shown in Figure 3 with three basic components: communication bus and two nodes: source node (sensor node) and destination node (actuator node). The nodes cooperate throughout the network to provide the end-to-end functionality. In a real-time system, this end-to-end functionality, from event to response, must be provided within a specified deadline. The response Sensor node Sensor Event Bus Object Response time Figure 3. Two nodes NMCS. Actuator node Actuator Driven Relative deadline time R i on event i should be lower than deadline D i. Timing analysis is applied to a resource being shared between multiple activities. According to the NMCS model shown in Figure 2, on an application level, the several sensor and actuator node functions are executed by a single microprocessor. On a communication stack level, the output and input messages wait in queue to be served and finally carry a number of messages sent by nodes on a network layer on one bus. To simplify timing analysis of a sensor to actuator node communication, we partition the analysis into components that can be analyzed independently, as shown in Figure 4. t T-task activation period R-response time Application layer Sensor node Communication stack layer Sensor node Communication layer Bus Communication stack layer Actuator node Application layer Actuator node t Task waiting time, Task executing time, (C w = j + B + I) (C) Figure 4. End-to-end communication timing analysis.

6 Elements: E Communication in Measuring Systems For task τ i, release jitter time J i, blocking time B i, and interference time I i are joined together and represented by the gray area (waiting time) to the left of the execution time windows shown in Figure 4. End-to-end response time depends on the response time of each component involved in meeting the deadline. Different offline scheduling policies could be investigated using this simple control loop as an example. If preemption is used, the blocking time corresponds to the longest duration of a low-priority code sequence that must run in mutual exclusion of the task. Without preemption, blocking is the duration of the longest lower-priority task. The interference time equals the total execution time of higher-priority tasks that may appear during the maximum response time. In Figure 4 are shown execution times of tasks on the two nodes (sensor and actuator), and the communication task execution time on the bus. An execution window represents each activity. The left end of the box represents task arrival and the right end represents the latest task completion. The length of the box represents the task response time on a given level. The activity may be finished at any time after the minimal execution time represented by the length of the white box. In the worst case, release jitter and blocking and interference from other tasks may delay task execution. 6 SCHEDULING TASKS ON NODE In this section, the application of the scheduling theory to the design of a hypothetical, simple distributed real-time NMCS is reviewed. Before going into the analysis, a few assumptions about tasks and node real-time operating system (RTOS) are needed: The set of tasks and their priority is fixed and known. Each task must have unique priority. The task deadline is no longer than its period. During the designing stage, we can decouple scheduling of resources and analyze independently the scheduling of each node processor and each network. The same analysis technique for task scheduling on a processor node and message scheduling across the network will be used. Consider that the utilization-based test and the worstcase response time evaluation, assuming a set of four independent, periodic tasks, with deadline lower than the period, is implemented in single processor node as shown in Figure 5. Each task τ i is characterized by a worst-case computation time C i aperiod and relative deadline D i.thetasks deadline is lower than their period, so preemptive contexts Node Processor Task t 1 Priority = 1 T 1 = 250 ms, C 1 = 5 ms, D 1 = 10 ms R 1 =? Task t 2 Priority = 2 T 2 = 10 ms, C 2 = 2 ms, D 2 = 10 ms R 2 =? Task t 3 Priority = 3 T 3 = 330 ms, C 3 = 25 ms, D 3 = 50 ms R 3 =? Task t 4 Priority = 4 T 4 = 550 ms, C 4 = 29 ms, D 4 = 100 ms R 4 =? Figure 5. Single processor node. A set of node tasks with priority assignment according to DM priority order. with both RM and DM scheduling policy can be used. Tasks shown in Figure 5 are in DM priority order. To determine if a given set of independent tasks is schedulable, we use (1) and (3) introduced in Section 3. According to (1), the total processor utilization by four tasks τ 1 τ 4 is 0.29, which is less than 0.76, the bound for four tasks. Hence, these four tasks are schedulable. In the next step, the worst-case response time for each task should be calculated. In Figure 6 is shown the results of the worst-case response time analysis, obtained from (3) for τ 1 τ 4 tasks with priority assignment according to the DM method and preemptive context. The worst-case response time of a task for the preemptive context was introduced in Section 3. For each task, τ i the R i (ms) 600 500 400 300 200 100 0 250 5 10 5 10 2 10 7 330 550 Task 1 Task 2 Task 3 Task 4 C i D i R i 100 75 50 25 38 29 Figure 6. Results of a task scheduling with DM priority order for single processor node with task preemption.

Scheduling Systems 7 CAN bus Task 1 id = 5 T 1 = 250 ms C 1 = 5 ms D 1 = 10 ms R 1 =? Task 2 id = 6 T 2 = 10 ms C 2 = 2 ms D 2 = 10 ms R 2 =? Task 3 id = 25 T 3 = 330 ms C 3 = 25 ms D 3 = 50 ms R 3 =? Task 4 id = 42 T 4 = 550 ms C 4 = 29 ms D 4 = 100 ms R 4 =? Figure 7. CAN network and a set of node messages with id assignments according to DM priority order. worst-case response time R i is lower than the task relative deadline D i, so analyzed tasks set up in single processor node are schedulable. We can find that worst-case response time for task τ 2 is R 2 = 7 ms which is lower than the task deadline D 2 = 10 ms but, comparing with other tasks gives the smallest margin of safety S 2 = 3ms. R i (ms) 600 500 400 300 250 330 550 C i D i R i 7 SCHEDULING MESSAGES ACROSS A NETWORK Suppose we have a four node network as shown in Figure 7, each with one independent, periodic task with given time parameters (T,C, and D). Here we have four periodic messages to be transmitted on a CAN network. CAN is a peer-to-peer communications bus for sending and receiving short real-time messages of up to 1 Mbps. Each frame starts with an identifier that uniquely marks the frame see Tindell, Hansson and Wellings (1994). In our example, task τ 1 has id = 5, task τ 2 id = 6, task τ 3 id = 25 and the last one id = 42. This identifier is the transmitted most-significant bit first. It is important that no two nodes transmit frames with the same identifier as otherwise the arbitration will not work. The effect of the arbitration scheme is to assign a priority to each frame, being the value of the identifier, where a smaller number is a higher priority. This priority-based scheduling of network is suited to the application of schedulability analysis. Results of analysis and prediction of the worst-case response timing behavior of the NMCS based on a CAN bus, with non-preemptive DM approach for the communicationlevelareshowninfigure8. Analysis was carried out by the use of (2) and (4) for the non-preemption approach. The analysis was done for each task and completed when the recurrence equation had converged to a consistent response time. Only the task τ 4 time requirements are met. Time requirements for the task τ 3 are almost met; for soft real-time systems it could 200 100 0 32 5 10 10 2 10 31 100 25 5054 54 29 Task 1 Task 2 Task 3 Task 4 Figure 8. CAN network. Results of tasks scheduling with DM non-preemptive method. be acceptable. Task τ 1 and task τ 2, for the DM offline scheduling approach, exceed its deadline significantly. To reach schedulability on the CAN bus level we should increase the transmission rate to shorten the tasks execution time C. As we can see, tasks with the same time parameters on the node and network level are scheduled only on the node level: this uses the preemption approach in access of its resources and thus can miss its deadlines on the CAN bus level for the three tasks. 8 TRENDS The scheduling methods presented rely on deterministic techniques, which are based on worst-case execution times of tasks. This approach is sufficient for some types of timing constraints but is inadequate when relative constraints exist between tasks, and when execution times can range between lower and upper bounds. Developing novel techniques to solve this problem is needed. Most of the real-time scheduling algorithms are based on the assumption that no error occurs in real-time systems. In order to make the real-time scheduling algorithm

8 Elements: E Communication in Measuring Systems more realistic, task precedence constraints need to be taken into account. In mission critical applications, real-time tasks must tolerate faults. It would be interesting to combine proposed real-time analysis with real-time fault-tolerant scheduling algorithms for periodic real-time tasks in distributed systems. With the popularity of the Internet and the Ethernet, a new design tool for Web embedded real-time systems is needed. Switched Ethernet can deliver IP packets deterministically at low cost. Ethernet and IP networking is becoming a good choice for real-time working. RELATED ARTICLES Article 165, Introduction to Networked Instrumentation, Volume 1; Article 166, Instrument Interconnection, Volume 1; Article 78, Embedded Systems, Volume 1; Article 158, Microcontroller Systems, Volume 1; Article 173, Fieldbus Systems, Volume 1. REFERENCES Audsley, N., Burns, A., Richardson, M., Tindell, K. and Wellings, A. (1993) Applying New Scheduling Theory to Static Priority Pre-emptive Scheduling. Software Engineering Journal, 8(5), 285 292. Burns, A. (1991) Scheduling Hard Real-Time Systems. Software Engineering Journal, Special issue on Real-Time Systems, 6(4), 116 128. Joseph, M. and Pandya, P. (1986) Finding Response Time in Real-Time System. The Computer Journal, 29(5), 390 395. Kopetz, H. (1997) Real Time Systems: Design Principles for Distributed Embedded Applications, Kluwer Academic Publishers, Boston, MA. Lechoczky, J.P. (1990) Fixed Priority Scheduling of Periodic Tasks Sets with Arbitrary Deadlines, in 11 th IEEE Real- Time System Symposium, Lake Buena Vista, Florida, USA, pp. 201 209. Leung, J. and Whitehead, J. (1982) On the Complexity of Fixed Priority Scheduling of Periodic Real-Time Tasks. Performance Evaluation, 22(4), 237 250. Liu, C. and Layland, J. (1973) Scheduling Algorithms for Multiprogramming in Hard-Real-Time Environment. Journal of the ACM, 20(1), 46 61. Michta, E. (2002) Scheduling Theory in Networked Measurement Control System Design, in Proceedings of the IMECO- TC7 Symposium, Cracov (pp. 197 202). Ramamritham, K. and Stankovic, J. (1994) Scheduling Algorithms and Operating Systems Support for Real-Time System. Proceedings of the IEEE, 82(1), 55 67. Sha, L. and Sathaye, S.S. (1995) Distributed System Design Using Generalized Rate Monotonic Theory, Technical Report CMU/SEI-95-TR-011, Carnegie Mellon University, Pittsburgh, PA. Sha, L., Klein, M. and Goodenough, J. (1991) Rate Monotonic Analysis for Real-Time Systems, Technical Report CMU/SEI- 91-TR-6, Carnegie Mellon University, Pittsburgh, PA. Stankovic, J. (1988) Real-Time Computing Systems: the Next Generation. Hard Real-Time Systems. IEEE Computer Society Press, Los Alamitos, USA (pp. 14 38). Tindell, K. (1992) An Extendible Approach for Analysing Fixed Priority Hard Real-Time Tasks, Technical Report YCS-189, Department of Computer Science, University of York, York, UK. Tindell, K., Hansson, H. and Wellings, A. (1994) Analysis Real-Time Communications: Controller Area Network, in IEEE Real-Time System Symposium, San Juan, Puerto Rico (pp. 259 263).