performance evaluation of deadline -based and laxity ... · performance of multiprocessor...

6
Performance Evaluation of Deadline-based and Laxity-based Scheduling Algorithms in Real-time Multiprocessor Environments VAHID SALMANI 1 , MAHMOUD NAGHIBZADEH 1 , AMIRHOSSEIN TAHERINIA 2 , MALIHE BAHEKMAT 3 , SEDIGHEH KHAJOUIE NEJAD 3 Computer Engineering Department 1 Ferdowsi University of Mashhad, 2 Sharif University of Technology, 3 Islamic Azad University of Mashhad IRAN Abstract : - Scheduling algorithms play an important role in design of real-time systems. Owing to high processing power and low price of multiprocessors, real-time scheduling in such systems is more interesting; however, more complicated. Its complication is due to the fact that multiprocessors are composed of a number of processors that require more complex strategies in order to maintain the system’s performance over a desirable level. Earliest Deadline First (EDF) and Least Laxity First (LLF) are two well-known and extensively applie d dynamic scheduling algorithms which have been proved to be optimal on uniprocessor systems. However, neither of these algorithms is shown to be optimal on multiprocessors. Up until now, many researches have been done on aforementioned algorithms, but to the best of our knowledge, none of which has compared the efficiency of the two algorithms under similar conditions. Perhaps the main reason is that LLF algorithm is fully dynamic and impractical to implement. In this research, we have used a practical version of LLF which is called the Modified Least Laxity First (MLLF) algorithm instead of the traditional LLF and have compared its performance with the EDF algorithm. The MLLF is a job-level dynamic and optimal strategy on uniprocessor systems, similar to the EDF algorithm. We have comprehensively investigated the performance of EDF and MLLF from many different aspects. Key-Words: - real-time systems, multiprocessor systems, job-level dynamic scheduling, earliest deadline first, modified least laxity first 1 Introduction In real-time systems each task has a deadline before or at which it should be comple ted. A scheduling algorithm is a set of rules which determines which task should be executed in any given instance. Due to the tasks' criticality, scheduling algorithms should be timely and predictable. Real-time systems include power plant control systems, embedded tactical systems for military applications, flight mission control systems, traffic control systems, etc. One of the research fields in the area of real-time systems to which more attention has been recently paid are real-time multiprocessor systems. Multiprocessor platforms include several processors on which jobs can get executed. Modern multiprocessor systems made up of off-the-shelf enterprise components are not designed for real-time usage. Nevertheless, they have characteristics that make them interesting in real-time applications. Examples are their speed, high processing power and low price [2]. An important class of scheduling algorithms is priority driven which determines the order of tasks to be executed based on their priorities. Priority driven algorithms are divided into static and dynamic algorithms. An algorithm is considered to be static if it specifies the priorities of tasks only once and the priorities do not change during execution. In contrast, an algorithm is said to be dynamic if task priorities may change during execution [3]. This research is concentrated on the latter type i.e. dynamic scheduling algorithms. EDF and LLF are two common dynamic scheduling algorithms. Many researches have been conducted on EDF in multiprocessor environments. In this paper, we aim to compare a laxity-based with a deadline-based scheduling algorithm from different aspects and to analyze the experimental Proceedings of the 6th WSEAS Int. Conf. on Systems Theory & Scientific Computation, Elounda, Greece, August 21-23, 2006 (pp121-126)

Upload: nguyencong

Post on 24-Jul-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Performance Evaluation of Deadline -based and Laxity ... · performance of multiprocessor scheduling algorithms are preemption and migration. A task is ... general there is no optimal

Performance Evaluation of Deadline-based and Laxity-based Scheduling Algorithms in Real-time Multiprocessor Environments

VAHID SALMANI 1, MAHMOUD NAGHIBZADEH 1, AMIRHOSSEIN TAHERINIA 2, MALIHE BAHEKMAT 3, SEDIGHEH KHAJOUIE NEJAD 3

Computer Engineering Department 1 Ferdowsi University of Mashhad, 2 Sharif University of Technology,

3 Islamic Azad University of Mashhad IRAN

Abstract: - Scheduling algorithms play an important role in design of real-time systems. Owing to high processing power and low price of multiprocessors, real-time scheduling in such systems is more interesting; however, more complicated. Its complication is due to the fact that multiprocessors are composed of a number of processors that require more complex strategies in order to maintain the system’s performance over a desirable level. Earliest Deadline First (EDF) and Least Laxity First (LLF) are two well-known and extensively applied dynamic scheduling algorithms which have been proved to be optimal on uniprocessor systems. However, neither of these algorithms is shown to be optimal on multiprocessors. Up until now, many researches have been done on aforementioned algorithms, but to the best of our knowledge, none of which has compared the efficiency of the two algorithms under similar conditions. Perhaps the main reason is that LLF algorithm is fully dynamic and impractical to implement. In this research, we have used a practical version of LLF which is called the Modified Least Laxity First (MLLF) algorithm instead of the traditional LLF and have compared its performance with the EDF algorithm. The MLLF is a job-level dynamic and optimal strategy on uniprocessor systems, similar to the EDF algorithm. We have comprehensively investigated the performance of EDF and MLLF from many different aspects. Key-Words: - real-time systems, multiprocessor systems, job-level dynamic scheduling, earliest deadline first, modified least laxity first 1 Introduction In real-time systems each task has a deadline before or at which it should be comple ted. A scheduling algorithm is a set of rules which determines which task should be executed in any given instance. Due to the tasks' criticality, scheduling algorithms should be timely and predictable. Real-time systems include power plant control systems, embedded tactical systems for military applications, flight mission control systems, traffic control systems, etc. One of the research fields in the area of real-time systems to which more attention has been recently paid are real-time multiprocessor systems. Multiprocessor platforms include several processors on which jobs can get executed. Modern multiprocessor systems made up of off-the-shelf enterprise components are not designed for real-time usage. Nevertheless, they have characteristics that make them interesting in real-time applications.

Examples are their speed, high processing power and low price [2]. An important class of scheduling algorithms is priority driven which determines the order of tasks to be executed based on their priorities. Priority driven algorithms are divided into static and dynamic algorithms. An algorithm is considered to be static if it specifies the priorities of tasks only once and the priorities do not change during execution. In contrast, an algorithm is said to be dynamic if task priorities may change during execution [3]. This research is concentrated on the latter type i.e. dynamic scheduling algorithms. EDF and LLF are two common dynamic scheduling algorithms. Many researches have been conducted on EDF in multiprocessor environments. In this paper, we aim to compare a laxity-based with a deadline-based scheduling algorithm from different aspects and to analyze the experimental

Proceedings of the 6th WSEAS Int. Conf. on Systems Theory & Scientific Computation, Elounda, Greece, August 21-23, 2006 (pp121-126)

Page 2: Performance Evaluation of Deadline -based and Laxity ... · performance of multiprocessor scheduling algorithms are preemption and migration. A task is ... general there is no optimal

results. We have investigated MLLF algorithm for two reasons. Firstly, less research has been done on LLF in multiprocessors compared to EDF. Secondly, it has been shown that LLF has some advantages over EDF [4]. The rest of this paper is organized as follows. In part two, the mentioned dynamic scheduling algorithms are studied, and in part three we survey the scheduling policies in multiprocessor environments. Real-time system model and our research framework details are presented in section four. Section five includes various experiments on the algorithms being investigated, and finally we conclude in sixth part. 2 Related Work Dynamic scheduling means the algorithm makes its decision based on the existing tasks, but new tasks might arrive and may change the circumstances thus rescheduling might be needed [5]. Dynamic algorithms produce on-line schedules using appropriate and up-to-date information about the tasks and the environment. Since these algorithms perform on-line, they are supposed to be efficient and their sophistication affects the overall system's performance [6]. As indicated before, there are two well-known algorithms of this class: EDF and LLF. EDF algorithm [7] uses a task's deadline to determine its priority so that each task's priority is commensurate with its deadline. The highest priority belongs to the task with the closest deadline while the task with farthest deadline has the lowest prior ity. LLF algorithm [8] allocates maximum priority to tasks with minimum laxity. Laxity is defined as the time difference between time span to deadline and remaining execution time which indicates the available flexibility for scheduling of corresponding task. A Laxity of t means even if a task's execution defers insomuch t time units, it will still have the opportunity to meet its deadline. A major disadvantage of LLF is that if two or more tasks have the same laxity, they will lead to laxity tie which result in too many context switches, and consequently, vast degradation of scheduler's performance. It causes LLF to be impractical to implement [9]. In other words, LLF is a fully dynamic algorithm, and this fact may be the reason why less research has been conducted on LLF compared to EDF. Perhaps MLLF algorithm [9] can be named as the only practical variant of LLF. This algorithm solves the LLF's problem of extensive context switches by

deferring the preemptions until necessary and prevents the system's performance degradation. MLLF has been proved to be optimal on uniprocessors [9]. In this research, instead of LLF, we use MLLF i.e. the only practical variant of LLF. Any invocation of a periodic task is called a job release or a job arrival. EDF is categorized as job-level dynamic because it preserves the relative priority of each two jobs in a system, whereas, LLF is classified into the fully dynamic category as it may change the relative priority of two tasks during execution [10]. In fact, MLLF can be job-level dynamic version of LLF, and this better justifies the comparison of EDF and MLLF. 3 Scheduling in Multiprocessors As multiprocessor systems are applied in real-time applications, scheduling of real-time tasks in these systems is of much significance. Two important types of multiprocessor systems are identical and uniform parallel machines. In the former the processing power of all processors is the same, whereas, each processor might have a different processing power in the latter case [12]. In this paper we have conducted our research on the first type i.e. identical multiprocessors. Two important parameters affecting the performance of multiprocessor scheduling algorithms are preemption and migration. A task is said to be preempted if it is not completed, but its execution is not continued on the processor it was just running on [13]. If a task whose execution has been preempted, resumes its running on another processor, a migration has occurred [11]. Based on the two aforementioned factors, there are two types of scheduling policies in multiprocessor environments named global scheduling and partition scheduling. Global scheduling algorithms put all the arrived tasks with non-zero remaining execution time into a queue that is common among the processors. In a system with m processors, in every moment, m tasks having the highest priorities should be executing considering preemptions and migrations, if necessary [14]. Partition scheduling algorithms divide the task set into partitions (subsets) such that all the tasks within a partition are assigned to a processor. In this policy task migrations are not allowed [14]. As mentioned before, neither algorithm being investigated in this research is optimal on multiprocessors. In fact, it has been shown that in general there is no optimal scheduling algorithm for

Proceedings of the 6th WSEAS Int. Conf. on Systems Theory & Scientific Computation, Elounda, Greece, August 21-23, 2006 (pp121-126)

Page 3: Performance Evaluation of Deadline -based and Laxity ... · performance of multiprocessor scheduling algorithms are preemption and migration. A task is ... general there is no optimal

identical multiprocessors [15]. However, we try to find out which one generally shows a better performance through a comprehensive set of experiments. 4 Real-Time System Model This research is concentrated on identical multiprocessors in soft real-time environments. The algorithms being investigated are in the class of dynamic best effort, i.e. no feasibility check is performed before a task's execution, and there is no guarantee that tasks will not miss their deadlines [16]. These algorithms are on-line and use up-to-date information for the scheduling activities during the systems execution. We have focused on periodic tasks and each task's deadline is equal to its period. The reason for this choice is that it has been proved that a periodic task model is useful for modeling and analysis of real-time systems [17]. Moreover, load factor measurement is easier and more accurate for periodic tasks. All the tasks are synchronous i.e. their first request arrive simultaneously at the time zero. Such systems are common and applicable . The tasks are preemptable and in each scheduling event a dispatcher decides which task to be performed next. In addition, a task is not allowed to run concurrently (on more than one processor at a time). Tasks must declare their characteristics and requirements such as interval, deadline and Worst Case Execution Time (WCET) at their arrival. The intervals and executions times are correct multiples of one time slice. The actual execution time of each task is equal to its WCET. The tasks are assigned to the processors in a FCFS manner. This means that we allocate tasks to the first idle processor. It goes without saying that, in partition policy the subsequent executions of a task will exclusively occur on the same processor. Optimization 1: In the implementation of global algorithms we prevent migration of a task in two immediate, successive executions. This means that if a task has the chance to run in two consequent time slices, it is executed on the same processor. This approach leads to the reduction of migrations and as a result increases the system's efficiency. Optimization 2: In order to decrease extra and useless preemptions, we have taken an approach in which among the tasks with the same dynamic priority, we choose the tasks that was already running in the previous time slice.

We have investigated each of the EDF and the LLF algorithms with both global and partition policies. Hence, the concerned algorithms in this research are:

• Global Earliest Deadline First (gEDF • Partition Earliest Deadline First (pEDF) • Global Least Laxity First (gLLF) • Partition Least Laxity First (pLLF)

As indicated before, in this research we use MLLF instead of LLF and hereafter, by LLF, we mean its practical variant i.e. MLLF. 5 Experimental Results In this section, we study the mentioned algorithms using simulation. We consider load factor as main parameter and present its effect on the performance metrics below as dependent variables:

• success ratio • response time • total number of preemptions and migrations • CPU utilization • load balance

In the results that we present later, in order to minimize the influence of exceptional states, each experiment was repeated 100 times and the results were averaged out. The time of simulation is equal to a meta period. Meta period is referred to the smallest common multiple of all tasks' periods [13]. It should be considered that presented results are in fact the average of the obtained value from all processors. In the experiments of this part, the value of the parameters are as below, unless mentioned otherwise. • The number of task in the system is a random

number with a uniform distribution between 20 and 100.

• The period of tasks is a random number with a uniform distribution between 10 and 100000.

• WCET of each task is a random number between 1 and 40% of its period.

• Tasks are preemptable. • The number of processors is 8. • Load factor is equal to 8. • Domino effect is omitted and the actual

execution time of each task is equal to its worst case execution time. This is for the sake of more accurate measurement of load factor.

Proceedings of the 6th WSEAS Int. Conf. on Systems Theory & Scientific Computation, Elounda, Greece, August 21-23, 2006 (pp121-126)

Page 4: Performance Evaluation of Deadline -based and Laxity ... · performance of multiprocessor scheduling algorithms are preemption and migration. A task is ... general there is no optimal

5.1 Success Ratio The success ratio is defined as the ratio of the jobs that have been successfully completed to the jobs arrived to the system [13]. Load factor of task Ti is defined as the ratio of its worst case execution time (Ei) to its request period (Pi). For n periodic tasks, load factor is equal to [7]:

(1) 1

ni

i i

EL

P=

= ∑

In multiprocessor environments, the overall load factor is the sum of all processors' load factor. In this experiment, the load factor has been chosen between 0 and 20 in order to evaluate the performance of algorithms in both non-overloaded and overloaded conditions.

Fig. 1. Effect of load factor on success ratio

As illustrated in Figure 1, all of the algorithms show a near optimal performance in non-overloaded situations. Nonetheless, in overloaded conditions, the performance of the all methods dramatically descends. Although in these situations, deadline based policies show a better performance. Our observations say that tasks with more CPU requirements are more likely to loose their deadline. It is worth mentioning that the most significant deficiency of dynamic methods is their unpredictability [16] which means it is not clear that which tasks may miss their deadlines. 5.2 Response Time Response time is defined as the time between arriving a request and completion of its processing [7]. The smaller, its value is, the better it is, and obviously it is not influenced by the tasks which fail to meet their deadlines. The point that should be taken into consideration is that, because of presence of the tasks with different periods, the absolute numeric values are meaningless. Therefore, we use response ratio instead of response time and define it as the ratio of

a task's response time to its period. In calculation of these values, scheduling overhead and communication time between processors has been ignored.

Fig. 2. Effect of load factor on response time

Figure 2 depicts the observed response ratio. All the algorithms in non-overloaded conditions have close performances. In overloaded conditions, however, EDF based algorithms show a better performance. 5.3 Total Number of Preemptions and

Migrations One of the most significant factors, influencing scheduling overload is the number of produced preemptions and migrations, and our aim here is to measure their values for each of the algorithms. In this case, due to different number of tasks in diverse conditions, applying absolute numeral values is meaningless. As a result, we use preemption ratio and migration ratio, instead of preemption and migration, and define them as the ratio of the total number of preemption to the total number of arrived requests and the ratio of the total number of migrations to the total number of arrived requests, respectively. If the architecture of the multiprocessor machine is considered to be idealized, meaning that the cost of preemption equals the cost of a migration, then the overhead ratio is defined as summation of the preemption ratio and migration ratio. Figure 3 shows the observed overhead ratios. As being expected, the partition algorithms impose lower overhead on the system. However, the overhead of laxity-based policies is several times as much as that of deadline-based methods. Now, if the architecture of the system is considered to be realistic, meaning that the cost of each migration is several times as much as the cost of preemption, then the overhead of global methods

Proceedings of the 6th WSEAS Int. Conf. on Systems Theory & Scientific Computation, Elounda, Greece, August 21-23, 2006 (pp121-126)

Page 5: Performance Evaluation of Deadline -based and Laxity ... · performance of multiprocessor scheduling algorithms are preemption and migration. A task is ... general there is no optimal

will be far more than what has been illustrated in Figure 3. Despite the above diagrams, it seems that the only way to evaluate real overhead of different policies is their implementation in real environments.

Fig. 3. Effect of load factor on overhead ratio

5.4 CPU Utilization CPU utilization is the percentage of CPU time in which, it has not had idle processing with respect to the time passed [1]. Therefore, it does not include the times in which CPU has been idle or has been processing the jobs which have ultimately been missed. In Figure 4, the CPU utilization of the algorithms has been illustrated.

Fig. 4. Effect of load factor on CPU utilization

All the algorithms have approximately the same performance in non-overhead conditions and use the maximum possible CPU resources. Nevertheless, in overloaded conditions, the CPU utilization of LLF-based algorithms drops. As being expected, the global methods make better utilization than their corresponding partition. The reason for this phenomenon is that, in global case, tasks can migrate and processors have less idle times averagely.

5.5 Load Balance Load balance means steady distribution of load among processors in such a way that minimizes the load difference. Regular load balance among processors not only decreases the response time, but also increases system's reliability which is very significant in real-time systems [18]. Another advantage of a balanced system is the minimized total power consumption [19]. The length of schedule in balanced case is also minimized. We apply the formula below for defining the system's load balance:

(2) 11

p

ii

U U

p U=

−−

×

in which the p is the number of processors. U is the average CPU utilization and Ui is equal to the ith processor's utilization.

Fig. 5. Effect of load factor on load balance

Figure 5 illustrates the load balance in each of the investigated algorithms. Partition algorithms have much higher balance in non-overloaded conditions, however in overloaded conditions, global algorithms exceed them, and show higher load balance. 6 Conclusion In this research the performance of dynamic job-level algorithms in multiprocessor environment has been investigated. The experimental results show that in case of job-level dynamic scheduling, deadline based algorithms have supremacy over laxity based. This is the same result, we observed in fuzzy scheduling of mentioned algorithms [20]. Furthermore, in most conditions, global policies show a better performance than partition policies. However, as far as algorithms’ overhead or load balance is important, the partition algorithms have a better performance and are more preferable for applying. Our other observation was that in most conditions the performance of global laxity-based

Proceedings of the 6th WSEAS Int. Conf. on Systems Theory & Scientific Computation, Elounda, Greece, August 21-23, 2006 (pp121-126)

Page 6: Performance Evaluation of Deadline -based and Laxity ... · performance of multiprocessor scheduling algorithms are preemption and migration. A task is ... general there is no optimal

algorithm is much better than that of its corresponding partition and its behavior is very close to global EDF and has the potential to be considered for future research. References: [1] P. A. Laplante, Real-Time Systems Design and

Analysis, Wiley-IEEE Press, April 2004. [2] V. Bulow, J. Stohr, and G. Farber, An

Approach to Improve Predictability of Worst Case Execution Times of Real-Time Software Running on State of the Art Multiprocessor Systems. Technical report, Institute for Real–Time Computer Systems, Technical University of Munich, April 2005.

[3] J. A. Stankovic, K. Ramamritham, and S. Cheng, Evaluation of a flexible task scheduling algorithm for distributed hard real-time systems, IEEE Transactions on Computers, Vol. 34, No. 12, Dec. 1985, pp. 1130-1143.

[4] D. Towsley, and S.S. Panwar, On the Optimality of Minimum Laxity and Earliest Deadline Scheduling for Real-time Multiprocessors, EUROMICRO Workshop on Real-time, Jun 6-8, 1990, pp. 17-24.

[5] S. Saez, J. Vila, and A. Crespo, A Dynamic Real-Time Scheduler for Shared Memory Multiprocessors, the Eighth EUROMICRO Workshop on Real-Time Systems (12-14 June, 1996), pp 158-163.

[6] B. Hamidzadeh, and Y. Atif, Dynamic Scheduling of Real-Time Tasks, by Assignment, IEEE Concurrency, Vol. 6, No. 4, Oct. 1998, pp. 14-25.

[7] C. L. Liu, and J. W. Layland, Scheduling algorithms for multiprogramming in a hard real-time environment. JACM , Vol. 20, No. 1, Jan. 1973, pp. 46-61.

[8] A. Mok, Fundamental Design Problems of Distributed Systems for the Hard Real-Time Environment. Ph.D. Thesis, MIT, Department of EE and CS, MIT/LCS/TR-297, May 1983.

[9] S. H. Oh, and S. M. Yang, A Modified Least-Laxity-First Scheduling Algorithm for Real-Time Tasks, the 5th International Workshop on Real-Time Computing Systems and Applications (RTCSA '98), Hiroshima, Japan, October 27-29, 1998, pp. 31-36.

[10] J. Carpenter, S. Funk, P. Holman, A. Srinivasan, J. Anderson, and S. Baruah, A categorization of real-time multiprocessor scheduling problems and algorithms. Handbook on Scheduling Algorithms,

Methods, and Models, Chapman Hall/CRC, Boca Raton, Florida, 2004.

[11] A. Mohammadi, and S. G. Akl, Scheduling Algorithms for Real-Time Systems. Technical Report, Queen’s University, 2005.

[12] J. Goossens, and P. Richard, Overview of real-time scheduling problems, ninth international workshop on project management and Scheduling, Nancy, France, April 26-28 2004, pp. 13-22.

[13] B. Andersson, and J. Jonsson, Fixed-priority preemptive multiprocessor scheduling: to partition or not to partition, 7th International Conference on Real-Time Computing Systems and Applications (RTCSA'2000), Cheju Island, South Korea, December 12-14, 2000, pp. 337-346.

[14] S. Funk, J. Goossens, and S. Baruah, On-line scheduling on uniform multiprocessors, the 22nd IEEE Real-Time Systems Symposium (RTSS 2001), London, UK, December 2-6, 2001, pp. 183-192.

[15] K. Mok, and M. L. Dertouzos, Multiprocessor scheduling in a hard real-time environment, the 7th IEEE Texas Conference on Computing Systems, November 1978, pp. 5-12.

[16] K. Ramamritham, and J. A. Stankovic, Scheduling Algorithms and Operating System Support for Real Time Systems. IEEE Proceedings, Vol. 82, No. 1, Jan. 1994, pp. 55-67.

[17] J. Goossens, S. Baruah, and S. Funk, Real-time scheduling on multiprocessor, the 10th International Conference on Real-Time System, 2002.

[18] S. Vranes, Different approaches to real-time application allocation to a multiprocessor system, EUROMICRO Workshop on Real-Time, 14-16 June, 1989, pp. 18-23.

[19] H. Aydin, Q. Yang, Energy-Aware Partitioning for Multiprocessor Real-Time Systems, International Parallel and Distributed Processing Symposium (IPDPS'03), Nice, France, 22-26 April 2003, pp. 113-121.

[20] M. Sabeghi, H. Deldari, V. Salmani, M. Bahekmat, and T. Taghavi, A Fuzzy Algorithm for Real-Time Scheduling of Soft Periodic Tasks on Multiprocessor Systems, IADIS International Conference on Applied Computing, San Sebastian, Spain, February 25-28, 2006, pp. 467-471.

Proceedings of the 6th WSEAS Int. Conf. on Systems Theory & Scientific Computation, Elounda, Greece, August 21-23, 2006 (pp121-126)