Comparison between scheduling algorithms in RTLinux and VxWorks



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

Lecture 3 Theoretical Foundations of RTOS

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

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Performance Comparison of RTOS

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

Operating Systems. III. Scheduling.

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

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

OPERATING SYSTEMS SCHEDULING

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Operating System: Scheduling

Linux 2.4. Linux. Windows

RTAI. Antonio Barbalace (modified by M.Moro 2011) RTAI

Embedded Systems. 6. Real-Time Operating Systems

Enhancing the Monitoring of Real-Time Performance in Linux

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Scheduling 0 : Levels. High level scheduling: Medium level scheduling: Low level scheduling

LynxOS RTOS (Real-Time Operating System)

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

Real-Time Operating Systems.

CPU Scheduling. CPU Scheduling

Tasks Schedule Analysis in RTAI/Linux-GPL

Undergraduate Course Syllabus

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

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

Linux for Embedded and Real-Time Systems

Embedded & Real-time Operating Systems

Introduction. Scheduling. Types of scheduling. The basics

Resource Reservation & Resource Servers. Problems to solve

Common Approaches to Real-Time Scheduling

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

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

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

4. Fixed-Priority Scheduling

Real-time Operating Systems. VO Embedded Systems Engineering Armin Wasicek

Threads Scheduling on Linux Operating Systems

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

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

OS OBJECTIVE QUESTIONS

ICS Principles of Operating Systems

Real-Time Scheduling 1 / 39

Operating Systems Lecture #6: Process Management

Process Scheduling. Process Scheduler. Chapter 7. Context Switch. Scheduler. Selection Strategies

CPU Scheduling Outline

What is an RTOS? Introduction to Real-Time Operating Systems. So what is an RTOS?(contd)

Chapter 5 Process Scheduling

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

Quality of Service su Linux: Passato Presente e Futuro

Job Scheduling Model

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

Real Time Operating System for Embedded DSP Applications

Real- Time Scheduling

A Comparative Study of CPU Scheduling Algorithms

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

EECE 276 Embedded Systems

Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

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

Weighted Total Mark. Weighted Exam Mark

Framework for Validation, Test and Analysis of Real-time Scheduling Algorithms and Scheduler Implementations

Operating Systems, 6 th ed. Test Bank Chapter 7

Predictable response times in event-driven real-time systems

Survey of software architectures: function-queue-scheduling architecture and real time OS

Computer Science 4302 Operating Systems. Student Learning Outcomes

CS Fall 2008 Homework 2 Solution Due September 23, 11:59PM

How To Understand And Understand An Operating System In C Programming

What is best for embedded development? Do most embedded projects still need an RTOS?

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

CPU Scheduling. Core Definitions

Asymmetric Scheduling and Load Balancing for Real-Time on Linux SMP

Red Hat Linux Internals

PROCESS SCHEDULING ALGORITHMS: A REVIEW

A Group based Time Quantum Round Robin Algorithm using Min-Max Spread Measure

Safe Kernel Scheduler Development with Bossa

W4118 Operating Systems. Instructor: Junfeng Yang

Why Threads Are A Bad Idea (for most purposes)

CS420: Operating Systems OS Services & System Calls

Real Time Operating Systems. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego.

Operating System Tutorial

OPERATING SYSTEM SERVICES

Operating Systems. Rafael Ramirez (T, S)

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

Today. Intro to real-time scheduling Cyclic executives. Scheduling tables Frames Frame size constraints. Non-independent tasks Pros and cons

Real Time Programming: Concepts

CPU Scheduling 101. The CPU scheduler makes a sequence of moves that determines the interleaving of threads.

Far-western University Central Office, Mahendranagar Operating System

Building Embedded Systems

Using EDF in Linux: SCHED DEADLINE. Luca Abeni

The Plan Today... System Calls and API's Basics of OS design Virtual Machines

Processor Scheduling. Queues Recall OS maintains various queues

A Priority based Round Robin CPU Scheduling Algorithm for Real Time Systems

Transcription:

Comparison between scheduling algorithms in RTLinux and VxWorks Linköpings Universitet Linköping 2006-11-19 Daniel Forsberg (danfo601@student.liu.se) Magnus Nilsson (magni141@student.liu.se)

Abstract The scheduler decides wich one of the available tasks that will be next to be processed by the CPU. To make this decision the scheduler checks the priority levels of the scheduled tasks and apply a predefined schedule algorithm. This report will compare the scheduling algorithms in the real-time operating systems RTLinux and VxWorks and comes to the conclusion that the two compared systems are roughly equivalent in most uses in regards to this.

Table of Contents 1 Introduction...4 2 Scheduling techniques...5 2.1 Round robin scheduling...5 2.2 First-in-first-out (FIFO) scheduling...5 2.3 Earliest-deadline-first (EDF) scheduling...5 2.4 Rate-monotonic scheduling...5 3 RTLinux...5 3.1 Scheduling in RTLinux...6 4 VxWorks...7 4.1 Scheduling in VxWorks...7 5 Conclusions...8 6 References...9

1 Introduction While many non-real-time operating systems try to implement realtime behaviour (sometimes only to get the "real-time"-label on their product) none or few of them get the response times required for a hard real-time system. A hard real-time system is a system that can assure task completion within its given time constrains. A system that can't guarantee task completion before deadline but still gives real-time tasks priority over ordinary tasks is called a soft real-time system. The entity "task" is used throughout this text as both RTLinux and WxWorks sees processes and threads as tasks. RTLinux and VxWorks are two of the most videly used and successful hard real-time operating systems on the market today and therefore makes good examples of how efficient scheduling can be implemented. In section X we discuss the RTLinux os, in section Y we dvelve into the VxWorks RTOS and our conclusions are found in section W.

2 Scheduling techniques 2.1 Round robin scheduling Round-robin scheduling gives every process with the same priority a pre-set share of time before making a context switch to the next task. When all tasks have got their time share, the first task gets back into the CPU for it's next processing. 2.2 First-in-first-out (FIFO) scheduling The scheduler runs the task with the highest priority first. If there are two or more tasks that share the same priority level, they get scheduled in order of their arrival completing the first arrived task first before continuing with the next one. Each task is occupng the CPU until it finishes or another task with higher priorty arrives. 2.3 Earliest-deadline-first (EDF) scheduling This scheduling policy ignores the priority level for each task. Instead it focus on when each task has to be finished, choosing the task with the closest deadline for execution. The more accurate the provided deadlines are, the better CPU utilization can be expected. 2.4 Rate-monotonic scheduling The rate-monotonic scheduling algorithm sets the priority level for each task in order of their period length, tasks with short periods (they executes often) will get a high priority while tasks with long periods gets low priority. High priority tasks then take preceedence before lower priory tasks. This scheduling algorithm is best used if there are well defined periodic tasks, prefereable with the same CPU burst length (the time spent in the CPU for each instance of the task). 3 RTLinux RTLinux by FSMLabs is a commercial hard realtime operating system that is used in many embedded systems worldwide. Instead of using the preemptive kernel of Linux for real-time applications, RTLinux uses a specially designed realtime kernel

called RTCore. This means that RTLinux actually is running two kernels, both the real-time kernel for time-critical applications as well as a normal Linux kernel for regular applications without time constraints. All interrupt handling and thread scheduling is controlled by the RTCore wich directs each interrupt to the appropriate interrupt handler, either in the real-time kernel or the standard Linux kernel. RTCore also prevents the Linux kernel from disabling interrupts, making sure that Linux doesn't interfere with the RTCore scheduling. The Linux kernel is only allowed to run when there is no current real-time demands - it is treated as a lowest level priority task by RTCore. Interrupts to the Linux system are in fact emulatetd interrupts as they allready passed the RTCore interrupt handler. Realtime applications are able to communicate with Linux programs through FIFO pipes and/or shared memory. The POSIX (Portable Operation System Interface exchange) API threading functions are implemented in RTCore, lowering the learning curve for programmers allready familiar with this API. From the RT kernel's point of view, the regular Linux kernel is just another task and this allows it to give higher priority to real time applications. From the user's point of view, this means that a system running RTLinux has all the available functionality of an ordinary Linux while still providing full real time capability. 3.1 Scheduling in RTLinux RTLinux can use different scheduling algorithms depending on the needs of it's users. RTLinux uses a simple FIFO scheduling but can also use EDF and ratemonotonic scheduling if so desired. For compatibility reasons RTLinux makes available the POSIX function calls for scheduling, but ignores those calls.

4 VxWorks VxWorks by Wind River Systems has been on the market for many years, evolving as the market's needs have changed over time. In contrast to RTLinux, WxWorks runs only one kernel - the Wind microkernel. This microkernel handles only the most basic kernel functions, which means that additional features like file handling, networking, etc, are loaded from provided libraries as needed. This gives high flexibility when designing a system, as one can set the system up to fit the needs of functionality while keeping strict constraints on available memory and other resources. The WxWorks kernel uses POSIX API and the Pthread API for real-time threads and processes. 4.1 Scheduling in VxWorks All work carried out in VxWorks is in the form of tasks. Each task can be in one of four different states; ready, delay, pending and suspend state. Ready tasks are those tasks available for running. Delayed tasks are sleeping for a set amount of time. Pending tasks are waiting for a resource to be available. The suspended state is what newly created tasks are set to until they get activated, something which however usually is done when the task is created, so this state is primarily used for debugging purposes. VxWorks uses a priority based preemptive round-robin scheduling algorithm. Each task have a priority level between 0 and 255 where 0 is the highest priority and 255 the lowest priority. If a task with higher priority than the task currently running in the CPU is called, the scheduler suspends the first task and sets the CPU to running the second task. If the second task has the very same priority level as the first task, round-robin scheduling is provided. As mentioned earlier, a task can also turn into a pending state, for example if a resource for that task isn't available. The scheduler then swaps back to a task with lower priority until the resource becomes available again. VxWorks also supports the POSIX API for real time threads, which makes available both the above described round robin as well as FIFO scheduling which is described above in the RTLinux-section. VxWorks scheduling is thus flexible and adopts easily to the needs of the customer.

5 Conclusions Both RTLinux and VxWorx handle several different methods of task scheduling, making them both candidates for several different software projects. Only VxWorks support the functionality in the POSIX API for threads, VxWorks uses a priority based scheduling algorithm and can use this to implement both a roundrobin scheduling as well as a first-come-first-served scheme, while RTLinux may use diferent scheduling algorithm's such as earliest-deadline-first or rate-monotonic scheduling, but also the first-come-first-served that VxWorks can use. Thus, both systems are fairly flexible and if a FIFO or priority based scheduling is desired, the choice of which system to use should not be based upon the desired scheduling method, as both can handle this in the desired way. To conlude, RTLinux has EDF and Rate-monotonic scheduling available, so if either of these are wanted, RTLinux should be the chosen system while VxWorks would be the nessecary choice if a round-robin scheduling is needed. In all other cases, they are equivalent as far as scheduling goes, and decisions must be made on other merits of the two systems.

6 References Silberschatz, Galvin and Gagne: Operating System Concepts, 7 th ed., John Wiley & Sons, 2005. http://windriver.com http://rtlinux.org