Outline. EE899.6 Embedded System and SOC. Embedded Operating Systems. Operating Systems. Regular Operating Systems. Embedded Operating Systems

Size: px
Start display at page:

Download "Outline. EE899.6 Embedded System and SOC. Embedded Operating Systems. Operating Systems. Regular Operating Systems. Embedded Operating Systems"

Transcription

1 Outline EE899.6 Embedded System and SOC RTOS and Scheduling In this slide set, we will learn: The role of embedded operating systems Commercial and free real-time operating systems Department of Electrical Engineering University of Saskatchewan 2 Operating Systems CPU Device Drivers (Real-Time) Operating System Control Software Operating system Controls access to the processors Controls access to the device drivers Embedded Operating Systems Does an embedded system need an OS? Not necessarily We can write our code as one big program, in particular for memory-constrained systems Need to develop device drivers But a (real-time) OS will make your task much easier Otherwise, the code would be too complex Time-to-market, security, reliability 3 4 Embedded Operating Systems Can we use a regular operating system for embedded systems design? Regular OS: on average, make things fast. They are not designed with real-time in mind RTOS: Do everything in a bounded time. (Note the difference between fast and realtime) A regular embedded OS might be fine for many applications. Regular Operating Systems Process/Task Management Memory Management Interrupt Handling Exception Handling Process/Task Synchronization CPU Scheduling Disk Management 5 6 1

2 Real-Time Operating Systems Process/Task Management Tasks might have deadlines (hard or soft) Memory Management Not likely to use virtual memory (why?) Interrupt Handling Very important Exception Handling Process/Task Synchronization Avoid priority inversion (the highest-priority ready task fails to run when it should) CPU Scheduling Time Management Commercial RTOS Wind River: VxWorks Microsoft: Windows Embedded Windows CE, Windows XP Embedded Palm Source: Palm OS RadiSys: Microwave OS-9 LinuxWorks: LynxOS QNX: Neutrino 7 8 Free RTOS Embedded Linux ecos μc/os-ii Selecting a RTOS Network capability Security GUI Hardware platform (x86, ARM, 68K, etc.) Portability IDE (compiler, assembler, debugger, etc.) Size (ROMable, etc.) 9 10 Outline Multitasking In this slide set, we will learn: The goal of processor scheduling Preemptive and non-preemptive scheduling Scheduling criteria The ability of the operating system to handle multiple activities within set deadlines Many tasks of execution appear to be running concurrently; however, the kernel is actually interleaving executions sequentially, based on a preset scheduling algorithm The scheduler must ensure that the appropriate task runs at the right time

3 Scheduler Scheduling Disciplines The scheduler is the heart of a process management unit that determines which task to execute next. Non-preemptive: Once the system has assigned a processor to a task, the system cannot remove the processor from that task. Preemptive: The system can remove the processor from the task Preemptive Scheduling The processor may execute a portion of a task s code and then perform a context switch Useful in systems in which high-priority tasks requires rapid response For example, real-time systems Helps guarantee acceptable user response times in interactive timesharing systems Preemptive Scheduling (cont.) Context switches incur overhead The system must maintain many tasks in main memory so that the next task is ready when a processor becomes available Non-Preemptive Scheduling Each task runs to completion or until it voluntarily relinquishes its processor Errant programs may never relinquish control of the processor Use periodically generated interrupts (interrupt clock or interval timer) to prevent a task from monopolizing the processor Short tasks can experience lengthy service delays Low-priority tasks can make high-priority tasks wait Priority Static priority Priorities remain fixed Relatively easy to implement Not responsive to changes in environment to increase throughput or reduce latency Dynamic priority Responsive to change. For example, increase the priority of a key resource needed by a higher-priority of a process priority inversion. More complex to implement

4 Scheduling Criteria Processor bound or I/O bound processor bound: tasks tend to use all the processor time I/O bound: tasks tends to use processor only briefly and spend most of their time waiting for external resources to service their requests Batch or interactive The scheduler should provide good response time to an interactive process Batch processes generally can suffer reasonable delay Scheduling Criteria (cont.) Priority The scheduler should favor tasks with higher priorities Under some disciplines, frequently preempted processes receive less treatment. Why? Scheduling Criteria (cont.) Preemptive schedulers often maintain information about how much real time each task has received Should a process that has received little execution time should be favored? Or a process that has received much execution time could be near completion and should be favored? Outline In this slide set, we will learn: Common scheduling algorithms FIFO, RR, SRR, SPF, HRRN, SRT Fair share scheduling First-In-First-Out (FIFO) Tasks are dispatched according their arrival time at the ready queue Also called first-come-first-serve Non-preemptive Long tasks make short tasks wait, unimportant tasks make important tasks wait, etc. Rarely used as a master scheme in today s systems, but often found within other schemes Tasks with the same priority are dispatched in FIFO order 23 Round-Robin Tasks are dispatched FIFO but are given a limited amount of time called time slice or quantum If a task does not complete before its quantum expires, the system preempts it and gives the processor to the next waiting task The preempted task is placed at the back of the ready queue Effective for interactive environments Like FIFO, rarely used as the master scheme 24 4

5 Selfish Round-Robin (SRR) Gradually increase task priorities over time Each task enters a holding queue as it enters the system Tasks in the holding queue ages and moved to a active queue when their priorities reaches the level of tasks in the active queue Tasks in the active queue are scheduled round-robin Older tasks are favored over those that have just entered the system Selfish Round-Robin (SRR) Tasks in the holding queue increase their priorities at a rate a, while in the active queue, at a rate b. When a >> b, SRR degenerates to RR When a = b, SRR degenerate to FIFO Tuning the parameters impacts how a process s age affects average latency and throughput Quantum Size Quantum size is critical to preemptive scheduling As the quantum gets larges, RR degenerates to FIFO As the quantum gets small, context-switching overhead dominates Large enough for vast majority of I/Obound tasks to complete their requests Maximizes I/O utilization and provides rapid response times for interactive tasks 27 Quantum Size (cont.) Optimal quantum varies from system to system and under different loads In Linux, default quantum is 100ms, but can vary from 10 to 200ms depending on process priority and behavior In Windows XP, default quantum is 20ms on most systems depending on architecture and behavior 28 Shortest-Process-First (SPF) The task with the smallest estimated runtime-to-completion is selected first Non-preemptive Reduced average waiting time over FIFO The waiting times have a larger variance; i.e., more unpredictable than FIFO Requires precise knowledge of how long a task will run - Usually not available Rely on user estimates 29 Highest-Response-Ratio-Next (HRRN) A modified version of SPF Correct the excessive bias against longer tasks and the excessive favoritism toward short tasks Each task s priority is a function not only of its service time but also of its waiting time Each running task runs to completion time waiting + service time priority = service time 30 5

6 Shortest-Remaining-Time (SRT) The preemptive counterpart of SPF A newly arriving task with a shorter estimated run-time preempts a running task with a longer run-time-to-completion Attempting to increase throughput by servicing small arriving tasks Effective for job-processing systems that receive a stream of incoming jobs No longer useful in most of today s systems Fare Share Scheduling 100% System Resources Fair Share Scheduler 60% 30% 10% Process Scheduler Process Scheduler Process Scheduler Tasks Tasks Tasks Outline In this slide set, we will learn: Deadline scheduling Types of real-time scheduling Overview of two basic real-time scheduling algorithms It is no use running, it is better to leave on time. - La Fontain, Le lièvre et la routue Deadline Scheduling Tasks are to be completed by a specific time Important to real-time scheduling Deadline scheduling is complex The user must supply the precise resource requirements in advance Such information rarely available Must execute the deadline tasks without severely degrading service to other tasks Intensive resource management may generate substantial overhead Must carefully plan system resources through to the deadlines New processes may make unpredictable demands When many deadline tasks are active at once, scheduling could become extremely complex Types of Real-Time Scheduling Algorithms Static real-time scheduling algorithms Do not adjust task priority over time Priorities are calculated only once Tend to be simple and incur little overhead Good for hard real-time systems (?) Dynamic real-time scheduling algorithms Schedule tasks by adjusting their priorities May incur significant overhead Types of Real-Time Scheduling Algorithms Off-line scheduling algorithms A scheduling algorithm is executed on the entire task set before actual task activation On-line scheduling Scheduling decisions are taken at run-time every time a new task enters the system or when a running task terminates

7 Off-Line Scheduling Algorithms The schedule generated is stored in a table and later used by a dispatcher Low run-time overhead Independent of the complexity of the scheduling algorithm Inflexible to changes Static Real-Time Scheduling Rate-monotonic (RM) algorithm Increase task s priority linearly (i.e., monotonically) with the frequency (i.e., the rate) with the frequency it must execute Favors periodic tasks that execute frequently Preemptive Priority-based Dynamic Real-Time Scheduling Earliest-deadline-first (EDF) algorithm Dispatch the task with the earliest deadline Preemptive Maximize throughput by satisfying the deadlines of the largest number of tasks per unit time Minimize average waiting time Outline In this slide set, we will learn: Rate-monotonic (RM) algorithm Optimality of RM algorithm Earliest Deadline First (EDF) algorithm Least Laxity First (LLF) algorithm Release Time Release Time: r 1 = 4 Given two periodic tasks : τ 1 (r 1, 1, 4, 4) : τ 2 (0,10,14,14) Consider different values for r 1, r 1 = 4 r 1 = 2 r 1 = Response time =

8 Release Time: r 1 = 2 Release Time: r 1 = Response time = Response time = Optimal Scheduling Algorithm Feasible schedule A scheduling algorithm results in a schedule for a task set. This schedule is feasible if all the tasks meet their timing constraints. Schedulable task set A task is schedulable when a scheduling algorithm is able to provide a feasible schedule. Optimal scheduling algorithm An algorithm is optimal if it is able to produce a feasible schedule for any schedulable task set. Schedulability Test of RM Algorithm (Off-Line) A set of periodic task with deadlines equal to periods is schedulable with the RM algorithm if the processor utilization factor satisfy n i= 1 C T i i n ( n 1/ n 1) Earliest Deadline First (EDF) Assign priority to task according to their absolute deadlines The task with the earliest deadline will be executed at the highest priority Does not make any assumption about the periodicity Can be used for both periodic as well as aperiodic tasks. Optimal If there exists a feasible schedule for a task set, EDF algorithm is able to find it Earliest Deadline First (EDF) A set of periodic task with deadlines equal to periods is schedulable with the EDF algorithm if and only if the processor utilization factor is less than or equal to 1: n i= 1 C T i i

9 Earliest Deadline First (EDF) A hybrid task set is schedulable with the EDF algorithm if: EDF Example τ 1 (0,3,7,20) τ 2 (0,2.4,5) τ 3 (0,1,8,10) n i= 1 Ci D i 1 Task Nominal Laxity: L Also called slack time L = D C If s: start time of task execution e: finish time of task execution L is the maximum lag for s when the task has sole use of the processor Residual Laxity: L(t) D(t): Residual relative deadline at time t D( t) = dk t 0 D( t) < D C(t): Pending execution time at time t D( t) = dk t 0 D( t) < D Residual Laxity Maximum lag for resuming execution of a task when it has sole use of the processor L( t) = D( t) C( t) = d t C( t) = r + D t C( t) k k Least Laxity First (LLF) Assigns priority to tasks according to their relative laxity The task with the smallest laxity will be executed at the highest priority Optimal The schedulability of a task set can be guaranteed using the EDF schedulability test Least Laxity First (LLF) Relative laxity of ready tasks decreases with time When the laxity of tasks is computed only at arrival times, LLF is equivalent to EDF. More context-switching overhead if the laxity is computed at every time t

10 LLF Example τ 1 (0,3,7,20) τ 2 (0,2.4,5) τ 3 (0,1,8,10) When t=0, L(τ 1 )=7-3=4, L(τ 2 )=4-2=2, L(τ 3 ) = 8-1 = 7 LLF Example When t=5, L(τ 2 )=2, L(τ 3 ) = Task 3 Task Outline In this slide set, we will learn: Hybrid task sets Scheduling of soft aperiodic tasks Background scheduling Task servers Slack stealing and joint scheduling Scheduling of hard aperiodic tasks Acceptance test algorithms Hybrid Task Sets Contain both periodic and aperiodic tasks Periodic tasks can be scheduled with one of the four basic algorithms; i.e., RM, DM, EDF, and LLF How to schedule aperiodic tasks? Aperiodic Tasks Soft aperiodic tasks Aperiodic tasks with soft time constraints Scheduling algorithms aim to provide good average response time for soft aperiodic tasks Hard aperiodic tasks Aperiodic tasks with hard time constraints Scheduling algorithms aims to maximize the guarantee ratio of the aperiodic tasks Scheduling of Soft Aperiodic Tasks Background scheduling Task server Slack stealing and joint scheduling

11 Background Scheduling Aperiodic tasks are scheduled in the background when there are no periodic tasks ready to execute Aperiodic tasks are queued according to a first-come-first-server strategy BG Scheduling Example Periodic tasks: τ 1 (0,2,5,5) τ 2 (0,2,10,10) Aperiodic tasks: τ 3 (4,2) τ 4 (10,1) τ 5 (11,2) Idle Time 62 BG Scheduling Example Idle times: [4,5], [7,10], [14,15], [17,20] Aperiodic tasks: τ 3 (4,2) τ 4 (10,1) τ 5 (11,2) Idle Time Task 3 Task 3 Task 4 Task 5 Aperiodic Tasks Background Scheduling The simplest method for scheduling aperiodic tasks For high loads caused by periodic tasks, response time of aperiodic requests can be high Task 3 Task 4 Task Task Servers A task server is a periodic task to serve aperiodic requests Two primary parameters Period Computation time; also called server capacity Use the same algorithm for the periodic tasks Ordering of aperiodic tasks does not depend on the scheduling algorithm for periodic tasks Several types of task servers: Polling server Sporadic server Polling Server Active at regular intervals equal to its period Serves pending aperiodic request within the limit of its capacity Suspends itself until its next period if no aperiodic requests are pending The time originally reserved for aperiodic tasks is used by periodic tasks

12 Polling Server Example Polling Server Example Periodic tasks: τ 1 (0,3,20,20) τ 2 (0,2,10,10) Aperiodic tasks: τ 3 (4,2) τ 4 (10,1) τ 5 (11,2) (0,3,20,20) Add a task server: τ s (0,2,5,5) Schedulability test: = 0.75 < 3( / 3 1) = (0,2,10,10) Task 3 Task 4 Task 5 Task Server Task 5 (0,2,5,5) Task 3 Task 4 Task 5 Server Capacity Polling Server Main drawback If aperiodic tasks enter the system just after the polling server suspends itself, the aperiodic tasks must wait until the next period of the task server. Sporadic Server The sporadic server preserve its capacity if no aperiodic requests are pending Improved response time for aperiodic tasks The replenishment time is set to t R plus the server period The replenishment amount is set to the capacity consumed by the sporadic tasks Sporadic Server Example Sporadic Server Example Periodic tasks: τ 1 (0,3,20,20) τ 2 (0,2,10,10) Aperiodic tasks: τ 3 (4,2) τ 4 (10,1) τ 5 (11,2) Task server: τ s (0,2,5,5) (0,3,20,20) (0,2,10,10) Task 3 Task 4 Task 5 Task Server Task 5 (0,2,5,5) Task 3 Task 4 Task 5 Server Capacity

13 Hard Aperiodic Task Scheduling Each time a new aperiodic task enters the system, an acceptance test is carried out to verify whether the new task can be scheduled within its deadline and without jeopardizing the deadlines of periodic tasks and previously accepted aperiodic tasks Background Scheduling with Acceptance Test Similar to the background scheduling, Aperiodic tasks are scheduled in the background Periodic tasks are scheduled with the EDF algorithm An on-line acceptance test is executed each time a new aperiodic request enters the system Acceptance Test Algorithm for Background Scheduling Computes the amount of processor idle time between the arrival time of the aperiodic task and its deadline. The amount of idle time must be at least equal to the computation time of the newly arrived aperiodic task If there is enough idle time, then verify that the execution of the new task does not jeopardize the guarantee of previously accepted tasks. If there is no enough idle time or if the new task will jeopardize the previously accepted tasks, the new task is rejected. Otherwise, the new task is accepted. Background Scheduling with Acceptance Test (0,2,4,5) Task 3 (0,1,8,10) Idle Time Task 4 Task 6 Task 5 Ape riodic Tasks Task 4 (4,2,10) Task 5 (10,1,18) Task 6 (11,2,16) Outline In this slide set, we will learn: Starting µc/os-ii Creating tasks Task states Overview Preemptive, priority-driven real-time scheduling Multitasking kernel that can manage up to 64 tasks. Written in C with microprocessor-specific code written in assembly language. Assembly language was kept to a minimum so that µc/os-ii can easily be ported to other target microprocessors Support many platforms: x86, 68x, MIPS, Memory footprint is about 20K for a fully functional kernel Source is open

14 Tasks Manage up to 64 tasks Each task must be assigned a unique priority level from 0 to OS_LOWEST_PRIO-2, inclusively. The lower the priority number, the higher the priority of the task OS_LOWEST_PRIO is reserved for system use 0, 1, 2, 3, OS_LOWEST_PRIO-3, LOWEST_RPIO-2, OS_PRIO- 1 are not recommended OS_MAX_TASKS and OS_LOWEST_PRIO are unrelated A task priority number also serves as the task identifier Always executes the highest priority task ready to run 79 Tasks Multitasking is started by calling OSStart OSStart must be called only once during startup and starts the highest priority task A task can be created prior to the start of multitasking or by another task You must create at least one task before you start multitasking The priority of a task can be changed by OSTaskChangePrio() A task can delete itself (return to dormant state) when done 80 Starting µc/os-ii void main (void) { /* Initialize µc/os-ii */ OSInit();.. /* Create at least 1 task using either OSTaskCreate() or OSTaskCreateExt() */. /* Start multitasking! OSStart will not return */ OSStart(); } Creating a Task A task is created by OSTaskCreate() or OSTaskCreateExt() OSTaskCreate() is backward compatible with µc/os-ii OSTaskCreateExt() is an extended version of OSTaskCreate() OSTaskCreate() requires four arguments task: pointer to the task code pdata: pointer to an argument that is passed to your task ptos: pointer to the top of the stack that is assigned to the task prio: task priority Task Stack Task States Dependent on processors, set OS_STK_GROWTH in OS_CPU.H to determine the direction that a stack grows Pass the lowest memory location of the stack to the task if OS_STK_GROWTH is set to 0 Pass the highest memory location of the stack to the task if OS_STK_GROWTH is set to 1 Example #define TASK_STK_SIZE 512 OS_STK TaskStk[TASK_STK_SIZE]; OSTaskCreate(Task, (void *)0, &TaskStk[TASK_STK_SIZE-1], 0); OSTaskDel OSMboxPost OSQPost OSSemPOst OSTaskCreate Task Task Dormant Ready OSTaskDel Task Waiting OSStart OSIntExit Task Preempted OSMboxPend OSQpend OSSemPend OStimeDly OSTimeDlyHSM Interrupt Task Running OSIntExit() ISR Running OSTaskDel

15 Task States Dormant: A task resides in program space (ROM or RAM) but has not been made available to µc/os-ii Ready: A task is ready to run when it is created. Tasks can be created before multitasking starts or dynamically by a running task Running: If multitasking has started and a task created by another task has a higher priority than its creator, the created task is given control of the CPU immediately There must be only one running task ISR Running: A task is preempted by an interrupt Waiting: A task is waiting for certain events to occur Ready List Ready list consists of two variables, OSRdyGrp and OSRdyTbl[] Task priorities are grouped (eight tasks per group) in OSRdyGrp Each bit in OSRdyGrp indicates when a task in a group is ready to run When a task is ready to run, the corresponding bit in OSRdyTbl[] is also set to Task Scheduling Always executes the highest task ready to run OSSchedLock() function is used to prevent task rescheduling until OSSchedUnlock() is called OSSchedLock() and OSSchedUnlock() must be used in pairs The task that calls OSSchedLock() keeps control of the CPU even though other higher priority tasks are ready to run Interrupts are still recognized and serviced (assuming interrupts are enabled). OSSchedLock() and OSSchedUnlock() must be used with caution 87 Idle Task µc/os-ii always creates a idle task that is executed when none of the other tasks are ready to run The idle task is always set to the lowest priority, OS_LOWEST_PRIO Maximum application tasks are Statistics Task µc/os-ii contains a task that provides run-time statistics The task is called OS_TaskStat() The statistic task is created by µc/os-ii if OS_TASK_STAT_EN is set to 1 in OS_CFG.H When enabled, OS_TaskStat() executes every second and computes the percentage of CPU usage The value is placed in a signed 8-bit integer variable, OSCPUUSage The resolution is 1 percent If your application uses the statistic task, you must call OSStatInit() from the first and only task created in your application during initialization 89 Critical Sections OS_ENTER_CRITICAL() and OS_EXIT_CRITICAL() are always used together Example { OS_ENTER_CRITICAL();.. /* µc/os-ii critical code section */. OS_EXIT_CRITICAL(); } 90 15

16 Critical Sections Your application might crash (hang) if you disable interrupts before calling a service such as OSTimeDly() As a general rule, always call µc/os-ii services with interrupts enabled Obtaining µc/os-ii Version You can obtain the current version of µc/os-ii from your application by calling OSVersion() OSVersion returns the version number multiplied by 100 µc/os-ii version 2.52 is returned as

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

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Based on original slides by Silberschatz, Galvin and Gagne 1 Basic Concepts CPU I/O Burst Cycle Process execution

More information

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS CPU SCHEDULING CPU SCHEDULING (CONT D) Aims to assign processes to be executed by the CPU in a way that meets system objectives such as response time, throughput, and processor efficiency Broken down into

More information

4. Fixed-Priority Scheduling

4. Fixed-Priority Scheduling Simple workload model 4. Fixed-Priority Scheduling Credits to A. Burns and A. Wellings The application is assumed to consist of a fixed set of tasks All tasks are periodic with known periods This defines

More information

Lecture 3 Theoretical Foundations of RTOS

Lecture 3 Theoretical Foundations of RTOS CENG 383 Real-Time Systems Lecture 3 Theoretical Foundations of RTOS Asst. Prof. Tolga Ayav, Ph.D. Department of Computer Engineering Task States Executing Ready Suspended (or blocked) Dormant (or sleeping)

More information

CPU Scheduling. CPU Scheduling

CPU Scheduling. CPU Scheduling CPU Scheduling Electrical and Computer Engineering Stephen Kim (dskim@iupui.edu) ECE/IUPUI RTOS & APPS 1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

More information

The Real-Time Operating System ucos-ii

The Real-Time Operating System ucos-ii The Real-Time Operating System ucos-ii Enric Pastor Dept. Arquitectura de Computadors µc/os-ii Overview µc/os-ii Task Management Rate Monotonic Scheduling Memory Management µc/gui µc/fs Books and Resources

More information

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

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput Import Settings: Base Settings: Brownstone Default Highest Answer Letter: D Multiple Keywords in Same Paragraph: No Chapter: Chapter 5 Multiple Choice 1. Which of the following is true of cooperative scheduling?

More information

Operating Systems. III. Scheduling. http://soc.eurecom.fr/os/

Operating Systems. III. Scheduling. http://soc.eurecom.fr/os/ Operating Systems Institut Mines-Telecom III. Scheduling Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ Outline Basics of Scheduling Definitions Switching

More information

Periodic Task Scheduling

Periodic Task Scheduling Periodic Task Scheduling Radek Pelánek Motivation and Assumptions Examples of Periodic Tasks sensory data acquisition control loops action planning system monitoring Motivation and Assumptions Simplifying

More information

4003-440/4003-713 Operating Systems I. Process Scheduling. Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu)

4003-440/4003-713 Operating Systems I. Process Scheduling. Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu) 4003-440/4003-713 Operating Systems I Process Scheduling Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu) Review: Scheduling Policy Ideally, a scheduling policy should: Be: fair, predictable

More information

ICS 143 - Principles of Operating Systems

ICS 143 - Principles of Operating Systems ICS 143 - Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Note that some slides are adapted from course text slides 2008 Silberschatz. Some

More information

Processor Scheduling. Queues Recall OS maintains various queues

Processor Scheduling. Queues Recall OS maintains various queues Processor Scheduling Chapters 9 and 10 of [OS4e], Chapter 6 of [OSC]: Queues Scheduling Criteria Cooperative versus Preemptive Scheduling Scheduling Algorithms Multi-level Queues Multiprocessor and Real-Time

More information

Chapter 5 Process Scheduling

Chapter 5 Process Scheduling Chapter 5 Process Scheduling CPU Scheduling Objective: Basic Scheduling Concepts CPU Scheduling Algorithms Why Multiprogramming? Maximize CPU/Resources Utilization (Based on Some Criteria) CPU Scheduling

More information

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

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses Overview of Real-Time Scheduling Embedded Real-Time Software Lecture 3 Lecture Outline Overview of real-time scheduling algorithms Clock-driven Weighted round-robin Priority-driven Dynamic vs. static Deadline

More information

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

CPU Scheduling. Multitasking operating systems come in two flavours: cooperative multitasking and preemptive multitasking. CPU Scheduling The scheduler is the component of the kernel that selects which process to run next. The scheduler (or process scheduler, as it is sometimes called) can be viewed as the code that divides

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline Introduction to scheduling Scheduling algorithms 1 Direction within course Until now: interrupts, processes, threads, synchronization Mostly mechanisms

More information

Linux Process Scheduling Policy

Linux Process Scheduling Policy Lecture Overview Introduction to Linux process scheduling Policy versus algorithm Linux overall process scheduling objectives Timesharing Dynamic priority Favor I/O-bound process Linux scheduling algorithm

More information

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Operating Systems Concepts: Chapter 7: Scheduling Strategies Operating Systems Concepts: Chapter 7: Scheduling Strategies Olav Beckmann Huxley 449 http://www.doc.ic.ac.uk/~ob3 Acknowledgements: There are lots. See end of Chapter 1. Home Page for the course: http://www.doc.ic.ac.uk/~ob3/teaching/operatingsystemsconcepts/

More information

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

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run SFWR ENG 3BB4 Software Design 3 Concurrent System Design 2 SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.8 10 CPU Scheduling Chapter 11 CPU Scheduling Policies Deciding which process to run

More information

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

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum Scheduling Yücel Saygın These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum 1 Scheduling Introduction to Scheduling (1) Bursts of CPU usage alternate with periods

More information

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

Process Scheduling CS 241. February 24, 2012. Copyright University of Illinois CS 241 Staff Process Scheduling CS 241 February 24, 2012 Copyright University of Illinois CS 241 Staff 1 Announcements Mid-semester feedback survey (linked off web page) MP4 due Friday (not Tuesday) Midterm Next Tuesday,

More information

CPU Scheduling. Core Definitions

CPU Scheduling. Core Definitions CPU Scheduling General rule keep the CPU busy; an idle CPU is a wasted CPU Major source of CPU idleness: I/O (or waiting for it) Many programs have a characteristic CPU I/O burst cycle alternating phases

More information

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

Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d Comp 204: Computer Systems and Their Implementation Lecture 12: Scheduling Algorithms cont d 1 Today Scheduling continued Multilevel queues Examples Thread scheduling 2 Question A starvation-free job-scheduling

More information

快 速 porting μc/os-ii 及 driver 解 說

快 速 porting μc/os-ii 及 driver 解 說 快 速 porting μc/os-ii 及 driver 解 說 沈 智 明 晶 心 科 技 公 司 資 深 經 理 Email: jimmy@andestech.com WWW.ANDESTECH.COM Outline Application Building Blocks μc/os-ii/rtos Introduction μc/os-ii & FreeRTOS Merge μc/os-ii

More information

OPERATING SYSTEMS SCHEDULING

OPERATING SYSTEMS SCHEDULING OPERATING SYSTEMS SCHEDULING Jerry Breecher 5: CPU- 1 CPU What Is In This Chapter? This chapter is about how to get a process attached to a processor. It centers around efficient algorithms that perform

More information

Introduction. Scheduling. Types of scheduling. The basics

Introduction. Scheduling. Types of scheduling. The basics Introduction In multiprogramming systems, when there is more than one runable (i.e., ready), the operating system must decide which one to activate. The decision is made by the part of the operating system

More information

Comparison between scheduling algorithms in RTLinux and VxWorks

Comparison between scheduling algorithms in RTLinux and VxWorks 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

More information

949 Crestview Circle Weston, FL 33327 U.S.A. www.micrium.com. The Real-Time kernel V2.90. Release Notes. Copyright 2010, Micriµm All Rights reserved

949 Crestview Circle Weston, FL 33327 U.S.A. www.micrium.com. The Real-Time kernel V2.90. Release Notes. Copyright 2010, Micriµm All Rights reserved Micriµm 949 Crestview Circle Weston, FL 33327 U.S.A. www.micrium.com µc/os-ii The Real-Time kernel V2.90 Release Notes Copyright 2010, Micriµm All Rights reserved Phone: +1 954 217 2036 FAX: +1 954 217

More information

Konzepte von Betriebssystem-Komponenten. Linux Scheduler. Valderine Kom Kenmegne Valderinek@hotmail.com. Proseminar KVBK Linux Scheduler Valderine Kom

Konzepte von Betriebssystem-Komponenten. Linux Scheduler. Valderine Kom Kenmegne Valderinek@hotmail.com. Proseminar KVBK Linux Scheduler Valderine Kom Konzepte von Betriebssystem-Komponenten Linux Scheduler Kenmegne Valderinek@hotmail.com 1 Contents: 1. Introduction 2. Scheduler Policy in Operating System 2.1 Scheduling Objectives 2.2 Some Scheduling

More information

Real- Time Scheduling

Real- Time Scheduling Real- Time Scheduling Chenyang Lu CSE 467S Embedded Compu5ng Systems Readings Ø Single-Processor Scheduling: Hard Real-Time Computing Systems, by G. Buttazzo. q Chapter 4 Periodic Task Scheduling q Chapter

More information

CPU Scheduling Outline

CPU Scheduling Outline CPU Scheduling Outline What is scheduling in the OS? What are common scheduling criteria? How to evaluate scheduling algorithms? What are common scheduling algorithms? How is thread scheduling different

More information

Operating Systems Lecture #6: Process Management

Operating Systems Lecture #6: Process Management Lecture #6: Process Written by based on the lecture series of Dr. Dayou Li and the book Understanding 4th ed. by I.M.Flynn and A.McIver McHoes (2006) Department of Computer Science and Technology,., 2013

More information

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

Real-Time Scheduling (Part 1) (Working Draft) Real-Time System Example Real-Time Scheduling (Part 1) (Working Draft) Insup Lee Department of Computer and Information Science School of Engineering and Applied Science University of Pennsylvania www.cis.upenn.edu/~lee/ CIS 41,

More information

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

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems Chapter 19: Real-Time Systems System Characteristics Features of Real-Time Systems Chapter 19: Real-Time Systems Implementing Real-Time Operating Systems Real-Time CPU Scheduling VxWorks 5.x 19.2 Silberschatz,

More information

Predictable response times in event-driven real-time systems

Predictable response times in event-driven real-time systems Predictable response times in event-driven real-time systems Automotive 2006 - Security and Reliability in Automotive Systems Stuttgart, October 2006. Presented by: Michael González Harbour mgh@unican.es

More information

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

3. Scheduling issues. Common approaches /1. Common approaches /2. Common approaches /3. 2012/13 UniPD / T. Vardanega 23/01/2013. Real-Time Systems 1 Common approaches /1 3. Scheduling issues Clock-driven (time-driven) scheduling Scheduling decisions are made beforehand (off line) and carried out at predefined time instants The time instants normally

More information

Priority-Driven Scheduling

Priority-Driven Scheduling Priority-Driven Scheduling Advantages of Priority-Driven Scheduling Priority-driven scheduling is easy to implement. It does not require the information on the release times and execution times of the

More information

Aperiodic Task Scheduling

Aperiodic Task Scheduling Aperiodic Task Scheduling Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund, Informatik 12 Germany Springer, 2010 2014 年 11 月 19 日 These slides use Microsoft clip arts. Microsoft copyright

More information

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

Operating System Aspects. Real-Time Systems. Resource Management Tasks Operating System Aspects Chapter 2: Basics Chapter 3: Multimedia Systems Communication Aspects and Services Multimedia Applications and Communication Multimedia Transfer and Control Protocols Quality of

More information

Performance Comparison of RTOS

Performance Comparison of RTOS Performance Comparison of RTOS Shahmil Merchant, Kalpen Dedhia Dept Of Computer Science. Columbia University Abstract: Embedded systems are becoming an integral part of commercial products today. Mobile

More information

8. MicroC/OS-II Real-Time Operating System

8. MicroC/OS-II Real-Time Operating System 8. MicroC/OS-II Real-Time Operating System NII52008-7.0.0 Introduction Overview This chapter describes the MicroC/OS-II real-time kernel for the Nios II processor. MicroC/OS-II is a popular real-time kernel

More information

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

Scheduling 0 : Levels. High level scheduling: Medium level scheduling: Low level scheduling Scheduling 0 : Levels High level scheduling: Deciding whether another process can run is process table full? user process limit reached? load to swap space or memory? Medium level scheduling: Balancing

More information

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

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

More information

OS OBJECTIVE QUESTIONS

OS OBJECTIVE QUESTIONS OS OBJECTIVE QUESTIONS Which one of the following is Little s formula Where n is the average queue length, W is the time that a process waits 1)n=Lambda*W 2)n=Lambda/W 3)n=Lambda^W 4)n=Lambda*(W-n) Answer:1

More information

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

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1 Module 8 Industrial Embedded and Communication Systems Version 2 EE IIT, Kharagpur 1 Lesson 37 Real-Time Operating Systems: Introduction and Process Management Version 2 EE IIT, Kharagpur 2 Instructional

More information

Embedded Systems. 6. Real-Time Operating Systems

Embedded Systems. 6. Real-Time Operating Systems Embedded Systems 6. Real-Time Operating Systems Lothar Thiele 6-1 Contents of Course 1. Embedded Systems Introduction 2. Software Introduction 7. System Components 10. Models 3. Real-Time Models 4. Periodic/Aperiodic

More information

REAL TIME OPERATING SYSTEMS. Lesson-10:

REAL TIME OPERATING SYSTEMS. Lesson-10: REAL TIME OPERATING SYSTEMS Lesson-10: Real Time Operating System 1 1. Real Time Operating System Definition 2 Real Time A real time is the time which continuously increments at regular intervals after

More information

Overview of Presentation. (Greek to English dictionary) Different systems have different goals. What should CPU scheduling optimize?

Overview of Presentation. (Greek to English dictionary) Different systems have different goals. What should CPU scheduling optimize? Overview of Presentation (Greek to English dictionary) introduction to : elements, purpose, goals, metrics lambda request arrival rate (e.g. 200/second) non-preemptive first-come-first-served, shortest-job-next

More information

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

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No. # 26 Real - Time POSIX. (Contd.) Ok Good morning, so let us get

More information

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

Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2 Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2 Lecture Outline Scheduling periodic tasks The rate monotonic algorithm Definition Non-optimality Time-demand analysis...

More information

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

Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings Operatin g Systems: Internals and Design Principle s Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings Operating Systems: Internals and Design Principles Bear in mind,

More information

Exercises : Real-time Scheduling analysis

Exercises : Real-time Scheduling analysis Exercises : Real-time Scheduling analysis Frank Singhoff University of Brest June 2013 Exercise 1 : Fixed priority scheduling and Rate Monotonic priority assignment Given a set of tasks defined by the

More information

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

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1 Module 6 Embedded System Software Version 2 EE IIT, Kharagpur 1 Lesson 30 Real-Time Task Scheduling Part 2 Version 2 EE IIT, Kharagpur 2 Specific Instructional Objectives At the end of this lesson, the

More information

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

Real-Time Software. Basic Scheduling and Response-Time Analysis. René Rydhof Hansen. 21. september 2010 Real-Time Software Basic Scheduling and Response-Time Analysis René Rydhof Hansen 21. september 2010 TSW (2010e) (Lecture 05) Real-Time Software 21. september 2010 1 / 28 Last Time Time in a real-time

More information

Operating Systems, 6 th ed. Test Bank Chapter 7

Operating Systems, 6 th ed. Test Bank Chapter 7 True / False Questions: Chapter 7 Memory Management 1. T / F In a multiprogramming system, main memory is divided into multiple sections: one for the operating system (resident monitor, kernel) and one

More information

LAB 5: Scheduling Algorithms for Embedded Systems

LAB 5: Scheduling Algorithms for Embedded Systems LAB 5: Scheduling Algorithms for Embedded Systems Say you have a robot that is exploring an area. The computer controlling the robot has a number of tasks to do: getting sensor input, driving the wheels,

More information

Real-Time Scheduling 1 / 39

Real-Time Scheduling 1 / 39 Real-Time Scheduling 1 / 39 Multiple Real-Time Processes A runs every 30 msec; each time it needs 10 msec of CPU time B runs 25 times/sec for 15 msec C runs 20 times/sec for 5 msec For our equation, A

More information

Scheduling Aperiodic and Sporadic Jobs in Priority- Driven Systems

Scheduling Aperiodic and Sporadic Jobs in Priority- Driven Systems Scheduling Aperiodic and Sporadic Jobs in Priority- Driven Systems Ingo Sander ingo@kth.se Liu: Chapter 7 IL2212 Embedded Software 1 Outline l System Model and Assumptions l Scheduling Aperiodic Jobs l

More information

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6 Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6 Winter Term 2008 / 2009 Jun.-Prof. Dr. André Brinkmann Andre.Brinkmann@uni-paderborn.de Universität Paderborn PC² Agenda Multiprocessor and

More information

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

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010. Road Map Scheduling Dickinson College Computer Science 354 Spring 2010 Past: What an OS is, why we have them, what they do. Base hardware and support for operating systems Process Management Threads Present:

More information

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

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms Chapter 5: Process Scheduling To discuss evaluation criteria for selecting the CPUscheduling algorithm for a particular

More information

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

Process Scheduling. Process Scheduler. Chapter 7. Context Switch. Scheduler. Selection Strategies Chapter 7 Process Scheduling Process Scheduler Why do we even need to a process scheduler? In simplest form, CPU must be shared by > OS > Application In reality, [multiprogramming] > OS : many separate

More information

Chapter 2: OS Overview

Chapter 2: OS Overview Chapter 2: OS Overview CmSc 335 Operating Systems 1. Operating system objectives and functions Operating systems control and support the usage of computer systems. a. usage users of a computer system:

More information

Real Time Scheduling Basic Concepts. Radek Pelánek

Real Time Scheduling Basic Concepts. Radek Pelánek Real Time Scheduling Basic Concepts Radek Pelánek Basic Elements Model of RT System abstraction focus only on timing constraints idealization (e.g., zero switching time) Basic Elements Basic Notions task

More information

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

CPU Scheduling 101. The CPU scheduler makes a sequence of moves that determines the interleaving of threads. CPU Scheduling CPU Scheduling 101 The CPU scheduler makes a sequence of moves that determines the interleaving of threads. Programs use synchronization to prevent bad moves. but otherwise scheduling choices

More information

A LECTURE NOTE ON CSC 322 OPERATING SYSTEM I DR. S. A. SODIYA

A LECTURE NOTE ON CSC 322 OPERATING SYSTEM I DR. S. A. SODIYA A LECTURE NOTE ON CSC 322 OPERATING SYSTEM I BY DR. S. A. SODIYA 1 SECTION ONE 1.0 INTRODUCTION TO OPERATING SYSTEMS 1.1 DEFINITIONS OF OPERATING SYSTEMS An operating system (commonly abbreviated OS and

More information

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

174: Scheduling Systems. Emil Michta University of Zielona Gora, Zielona Gora, Poland 1 TIMING ANALYSIS IN NETWORKED MEASUREMENT CONTROL SYSTEMS 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

More information

Operating System Tutorial

Operating System Tutorial Operating System Tutorial OPERATING SYSTEM TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Operating System Tutorial An operating system (OS) is a collection

More information

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

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5 77 16 CPU Scheduling Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5 Until now you have heard about processes and memory. From now on you ll hear about resources, the things operated upon

More information

Commonly Used Approaches to Real-Time Scheduling

Commonly Used Approaches to Real-Time Scheduling Integre Technical Publishing Co., Inc. Liu January 13, 2000 8:46 a.m. chap4 page 60 C H A P T E R 4 Commonly Used Approaches to Real-Time Scheduling This chapter provides a brief overview of three commonly

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline Advanced scheduling issues Multilevel queue scheduling Multiprocessor scheduling issues Real-time scheduling Scheduling in Linux Scheduling algorithm

More information

CS414 SP 2007 Assignment 1

CS414 SP 2007 Assignment 1 CS414 SP 2007 Assignment 1 Due Feb. 07 at 11:59pm Submit your assignment using CMS 1. Which of the following should NOT be allowed in user mode? Briefly explain. a) Disable all interrupts. b) Read the

More information

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

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances: Scheduling Scheduling Scheduling levels Long-term scheduling. Selects which jobs shall be allowed to enter the system. Only used in batch systems. Medium-term scheduling. Performs swapin-swapout operations

More information

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

The Design and Implementation of Real-Time Schedulers in RED-Linux The Design and Implementation of Real-Time Schedulers in RED-Linux KWEI-JAY LIN, SENIOR MEMBER, IEEE AND YU-CHUNG WANG Invited Paper Researchers in the real-time system community have designed and studied

More information

10.04.2008. Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

10.04.2008. Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details Thomas Fahrig Senior Developer Hypervisor Team Hypervisor Architecture Terminology Goals Basics Details Scheduling Interval External Interrupt Handling Reserves, Weights and Caps Context Switch Waiting

More information

CHAPTER 15: Operating Systems: An Overview

CHAPTER 15: Operating Systems: An Overview CHAPTER 15: Operating Systems: An Overview The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint

More information

Operating System: Scheduling

Operating System: Scheduling Process Management Operating System: Scheduling OS maintains a data structure for each process called Process Control Block (PCB) Information associated with each PCB: Process state: e.g. ready, or waiting

More information

Common Approaches to Real-Time Scheduling

Common Approaches to Real-Time Scheduling Common Approaches to Real-Time Scheduling Clock-driven time-driven schedulers Priority-driven schedulers Examples of priority driven schedulers Effective timing constraints The Earliest-Deadline-First

More information

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading Announcements Reading Chapter 5 Chapter 7 (Monday or Wednesday) Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution What are the

More information

A Comparative Study of CPU Scheduling Algorithms

A Comparative Study of CPU Scheduling Algorithms IJGIP Journal homepage: www.ifrsa.org A Comparative Study of CPU Scheduling Algorithms Neetu Goel Research Scholar,TEERTHANKER MAHAVEER UNIVERSITY Dr. R.B. Garg Professor Delhi School of Professional Studies

More information

Linux Block I/O Scheduling. Aaron Carroll aaronc@gelato.unsw.edu.au December 22, 2007

Linux Block I/O Scheduling. Aaron Carroll aaronc@gelato.unsw.edu.au December 22, 2007 Linux Block I/O Scheduling Aaron Carroll aaronc@gelato.unsw.edu.au December 22, 2007 As of version 2.6.24, the mainline Linux tree provides four block I/O schedulers: Noop, Deadline, Anticipatory (AS)

More information

Linux scheduler history. We will be talking about the O(1) scheduler

Linux scheduler history. We will be talking about the O(1) scheduler CPU Scheduling Linux scheduler history We will be talking about the O(1) scheduler SMP Support in 2.4 and 2.6 versions 2.4 Kernel 2.6 Kernel CPU1 CPU2 CPU3 CPU1 CPU2 CPU3 Linux Scheduling 3 scheduling

More information

Operating Systems 4 th Class

Operating Systems 4 th Class Operating Systems 4 th Class Lecture 1 Operating Systems Operating systems are essential part of any computer system. Therefore, a course in operating systems is an essential part of any computer science

More information

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

CPU Scheduling. CSC 256/456 - Operating Systems Fall 2014. TA: Mohammad Hedayati CPU Scheduling CSC 256/456 - Operating Systems Fall 2014 TA: Mohammad Hedayati Agenda Scheduling Policy Criteria Scheduling Policy Options (on Uniprocessor) Multiprocessor scheduling considerations CPU

More information

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

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition Chapter 5: CPU Scheduling Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

More information

ò Paper reading assigned for next Thursday ò Lab 2 due next Friday ò What is cooperative multitasking? ò What is preemptive multitasking?

ò Paper reading assigned for next Thursday ò Lab 2 due next Friday ò What is cooperative multitasking? ò What is preemptive multitasking? Housekeeping Paper reading assigned for next Thursday Scheduling Lab 2 due next Friday Don Porter CSE 506 Lecture goals Undergrad review Understand low-level building blocks of a scheduler Understand competing

More information

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

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2) RTOSes Part I Christopher Kenna September 24, 2010 POSIX Portable Operating System for UnIX Application portability at source-code level POSIX Family formally known as IEEE 1003 Originally 17 separate

More information

Overview of the Linux Scheduler Framework

Overview of the Linux Scheduler Framework Overview of the Linux Scheduler Framework WORKSHOP ON REAL-TIME SCHEDULING IN THE LINUX KERNEL Pisa, June 27th, 2014 Marco Cesati University of Rome Tor Vergata Marco Cesati (Univ. of Rome Tor Vergata)

More information

Linux 2.4. Linux. Windows

Linux 2.4. Linux. Windows Linux 2.4 Non-preemptible kernel A system call might take long time to complete Coarse timer resolution Tasks can be released only with 10ms precision Virtual memory Introduces unpredictable amount of

More information

Solving Real-World Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Scheduler Xi Wang Broadcom Corporation Questions, Comments: xiwang@broadcom.com peknap@yahoo.com Introduction Higher

More information

Completely Fair Scheduler and its tuning 1

Completely Fair Scheduler and its tuning 1 Completely Fair Scheduler and its tuning 1 Jacek Kobus and Rafał Szklarski 1 Introduction The introduction of a new, the so called completely fair scheduler (CFS) to the Linux kernel 2.6.23 (October 2007)

More information

Embedded & Real-time Operating Systems

Embedded & Real-time Operating Systems Universität Dortmund 12 Embedded & Real-time Operating Systems Peter Marwedel, Informatik 12 Germany Application Knowledge Structure of this course New clustering 3: Embedded System HW 2: Specifications

More information

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems Lecture Outline Operating Systems Objectives Describe the functions and layers of an operating system List the resources allocated by the operating system and describe the allocation process Explain how

More information

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study CS 377: Operating Systems Lecture 25 - Linux Case Study Guest Lecturer: Tim Wood Outline Linux History Design Principles System Overview Process Scheduling Memory Management File Systems A review of what

More information

Enhancing the Monitoring of Real-Time Performance in Linux

Enhancing the Monitoring of Real-Time Performance in Linux Master of Science Thesis Enhancing the Monitoring of Real-Time Performance in Linux Author: Nima Asadi nai10001@student.mdh.se Supervisor: Mehrdad Saadatmand mehrdad.saadatmand@mdh.se Examiner: Mikael

More information

The simple case: Cyclic execution

The simple case: Cyclic execution The simple case: Cyclic execution SCHEDULING PERIODIC TASKS Repeat a set of aperiodic tasks at a specific rate (cycle) 1 2 Periodic tasks Periodic tasks (the simplified case) Scheduled to run Arrival time

More information

Resource Reservation & Resource Servers. Problems to solve

Resource Reservation & Resource Servers. Problems to solve Resource Reservation & Resource Servers Problems to solve Hard-deadline tasks may be Periodic or Sporadic (with a known minimum arrival time) or Non periodic (how to deal with this?) Soft-deadline tasks

More information

Overview and History of Operating Systems

Overview and History of Operating Systems Overview and History of Operating Systems These are the notes for lecture 1. Please review the Syllabus notes before these. Overview / Historical Developments An Operating System... Sits between hardware

More information

Aperiodic Task Scheduling

Aperiodic Task Scheduling Aperiodic Task Scheduling Gerhard Fohler Mälardalen University, Sweden gerhard.fohler@mdh.se Real-Time Systems Gerhard Fohler 2005 Non Periodic Tasks So far periodic events and tasks what about others?

More information

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

A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis Mark Stanovich Florida State University, USA Contents 1 Introduction 2 2 Scheduling Theory 3 2.1 Workload

More information