236 PRZEGLĄD ELEKTROTECHNICZNY (Electrical Review), ISSN 0033-2097, R. 87 NR 1/2011 Jerzy MARTYNA Jagiellonian University Scheduling algorithm for delay and jitter reduction of periodic tasks in real-time systems Abstract. Real-time systems, especially software control systems, are developed to meet the requirements of real-time automation systems. One such crucial requirement is reducing the delay and jitter of periodic tasks in such systems. In this paper, we present a new method for reducing delays and jitters of periodic tasks, which are enforced by the operating system, control tasks, kernel mechanisms, etc. Our algorithm is evaluated and compared with other scheduling algorithms in terms of jitter. The effectiveness of our algorithm is confirmed by the experimental results. Streszczenie. W pracy przedstawiono algorytm szeregowania dla redukcji fluktuacji i opóźnień zadań okresowych w systemach czasu rzeczywistego. Zastosowanie takiego algorytmu gwarantuje przewidywalność oraz poprawia efektywność działania systemów. Dodatkowo dzięki niemu jest możliwe zmniejszenie fluktuacji czasu odpowiedzi zadań okresowych. Możliwości działania prezentowanego algorytmu zostały potwierdzone w badaniach symulacyjnych. (Algorytm szeregowania dla redukcji fluktuacji i opóźnień zadań okresowych w systemach czasu rzeczywistego) Keywords: scheduling algorithms, real-time systems, periodic tasks, reducing the delay and jitter of periodic tasks. Słowa kluczowe: algorytmy szeregowania, systemy czasu rzeczywistego, redukcja fluktuacji i opóźnień zadań okresowych. Introduction In real-time control applications many periodic tasks are executed which are associated with periodic activities such as periodic execution of control tasks, action planning, etc. These tasks are periodically invoked by the scheduler implemented in the kernel of the operating system. The factors which degraduate the performance of real- time systems are delays and jitter appearing during the execution of periodic tasks. A jitter can be interpreted as disturbances acting upon the system which as a result of interrupts, calls of the operating system kernel, the activities of the scheduler, control programs, etc. In general, these disturbances have a negative effect on the system’s performance. This was confirmed in the research studies [8], [16]. The jitter has also been studied in many papers. Among others, J. Nilsson et al. [18] have carried out a stochastic analysis and control of real-time systems with random time delays. A simulated annealing to find the optimal configuration task sets that minimizes jitter has been proposed by M. Di Natale and J. Stankovic in the paper [10]. In another paper, A. Cervin et al. [9] devised a method for finding the upper limit of the input-output jitter of each task by estimating the worst-case and best case response times under Earliest Deadline First (EDF) scheduling. This method introduce of the concept of the jitter margin, which guarantees system stabilization through the defined requirements of the jitter. Independently of the given results, other authors of papers [1], [13], [12] proposed different algorithms for computing the minimum deadline of a newly arrived task, assuming that the existing task set is schedulable by EDF algorithm. In the first of these, P. Balbastre et al. [1] provided the deadline minimisation algorithm. In this solution the deadline reduction achievable in the first task is much higher than that achievable for the other tasks in the sequence. In the given solution the deadline reduction achievable in the first task is much high er than that achievable in the other tasks in the sequence. The authors also proposed a method for achieving uniform scaling all relative deadlines using the critical scaling factor for task deadlines. However, as was stated in the paper by H. Hoang and G.C. Buttazzo [13], using this method the jitter and delay carnot be reduced as expected and for some tasks they could even increase. The paper [12] presents a method for computating the minimum deadlines for periodic tasks in the real-time systems. An optimal task rate selection method for fixed priority systems was prepared by E. Bini and M. Di Natale [4]. In this paper, the authors presented a method of periodic task selection. A schedulability analysis for a set of periodic tasks under an arbitrary fixed priority assignment was studied in depth by E. Bini and G.C. Buttazzo in paper [3]. A sensitivity analysis for a set of periodic tasks with fixe priorities was given In the paper [5]. The sensitivity analysis is of importance as the worst-case response time analysis. The problem of jitter and delay reduction in real-time control applicationswas also dealt with in another way. By setting a suitable relative deadline it was possible to limit the execution interval of each periodic task. Based on this metod S. Baruah et al. [2] proposed two algorithms for guaranteeing the schedulability of the task set. G.C. Buttazzo and F. Sensini [6] presented an ”on-line” algorithmto compute the minimum deadline to be assigned to a new arriving task to guarantee schedulability under the EDF algorithm. The same function is performed by the algorithm given by A. Kwiecień [14], which includes some methods for reducing the cycle In the programmable controler. A number of recent papers have described the conditions of periodic task scheduling using the EDF and RM (Rate Monotonic) algorithms [19]. Ph. Michelon et al. [17] offer a mathematical model of periodic task scheduling and Lower limits of time scheduling. A comparative assessment and evaluation of jitter control methods was presented by G.C. Buttazzo and A. Cervin [7]. The main goal of this paper is to present the scheduling algorithmfor reducing the deadlines of the periodic tasks that minimalize jitters and delays in real-time systems. This algorithm leads to better tuning and also keeps the stability of the real-time system. The paper is organized as follows. Section 2 presents the system model and the terminology used throughout the paper. In section 3, we give the scheduling algorithm for deadline reduction. Section 4 presents some simulation results and compares the proposed method with other algorithms. Finally, in section 5 we give our conclusions and plans for future work. The System model In this section, we present the system model which will be used throughout the paper. Suppose set } , ... , , { 2 1 n T of n periodic tasks that must be executable in the uniprocessor system. In the