Linux Process Scheduling. sched.c. schedule() scheduler_tick() hooks. try_to_wake_up() ... CFS CPU 0 CPU 1 CPU 2 CPU 3

Size: px
Start display at page:

Download "Linux Process Scheduling. sched.c. schedule() scheduler_tick() hooks. try_to_wake_up() ... CFS CPU 0 CPU 1 CPU 2 CPU 3"

Transcription

1 Linux Process Scheduling sched.c schedule() scheduler_tick() try_to_wake_up() hooks RT CPU 0 CPU 1 CFS CPU 2 CPU 3

2 Linux Process Scheduling 1. Task Classification 2. Scheduler Skeleton 3. Completely Fair Scheduler (CFS) sched.c schedule() scheduler_tick() try_to_wake_up() hooks RT 4. Real Time Scheduling (RT) 5. Load Balancing CFS CPU 0 CPU 1 CFS 6. Load Balancing RT CPU 2 CPU 3

3 1. Task Classification Task Types Real Time vs Normal/Other CPU bound vs I/O bound Efficient vs Responsive Server vs Desktop vs HPC

4 1. Task Classification Scheduling Classes include/linux/sched.h struct sched_class kernel/sched_rt.c rt_sched_class.next = &fair_sched_class const struct sched_class *next (*enqueue_task) (*dequeue_task) (*check_preempt_curr) (*pick_next_task) (*select_task_rq) (*pick_next_task).enqueue_task = &enqueue_task_rt.dequeue_task = &dequeue_task_rt kernel/sched_fair.c fair_sched_class.next = &idle_sched_class.enqueue_task = &enqueue_task_fair.dequeue_task = &dequeue_task_fair

5 1. Task Classification Scheduling Class Priorities stop rt fair idle per CPU stop task real time tasks normal tasks per CPU idle task Highest Lowest Priority

6 2. Scheduler Skeleton Scheduler Entry Point Per CPU runqueue with sub runqueues for CFS and RT Remove or put back to runqueue different task selected than before? Pull tasks from other CPUs kernel/sched.c schedule() Look for highest priority class with available tasks

7 2. Scheduler Skeleton Calling the Scheduler 1. Timer Interrupt 2. Currently running task goes to sleep 3. Sleeping task wakes up

8 2. Scheduler Skeleton Calling the Scheduler - Timer kernel/sched.c scheduler_tick() { sched_class->task_tick() } CPU 0 CPU 1 CPU 2 CPU 3 kernel/sched_x.c task_tick_x() { } X_sched_class update task s scheduling entity is it another task s turn yet? Yes Invoke scheduling

9 2. Scheduler Skeleton Calling the Scheduler - Sleep

10 2. Scheduler Skeleton Calling the Scheduler Wake up kernel/sched.c try_to_wake_up() { sched_class->enqueue_task() sched_class->check_preempt_curr() task.state = TASK_RUNNING } CPU 0 CPU 1 CPU 2 CPU 3 kernel/sched_x.c enqueue_task_x() { } check_preempt_curr_x() { } X_sched_class put task into runqueue Awoken task higher prio than current task? Yes Invoke scheduling

11 3. Completely Fair Scheduler Concept Virtual Runtime CFS tries to maintain an equal virtual runtime for each task in a CPU s runqueue at all time.

12 3. Completely Fair Scheduler Virtual Runtime Same Priority Target Latency 20ms 10ms 10ms Priorities Time elapses slower for higher priorities 5ms 5ms 5ms 5ms Minimum Granularity 1ms 1ms 1ms 1ms 1ms How does it work out for I/O bound and CPU bound Tasks?

13 3. Completely Fair Scheduler Runqueue - Red-Black-Tree Red-Black-Tree self balancing binary search tree O(logN) operations vruntime used as key in the RB-Tree gravest need for CPU 7 25 NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL virtual runtime

14 3. Completely Fair Scheduler Fair Group Scheduling Without Group Scheduling User 1 User 2 With Group Scheduling User 1 User 2 T0 T1 T2 T3 T0 T1 T2 T3 G1 50% G2 50% 25% 25% 25% 25% 16.7% 16.7% 16.7% 50% CPU CPU First, be fair to groups then, be fair to tasks.

15 4. Soft-Real-Time Scheduling Scheduling Modes Scheduling of tasks with strict timing requirements. RT scheduling is reliable but kernel does not guarantee that deadlines will be met. SCHED_FIFO no time slices until termination or yielding CPU T1 T2 T3 SCHED_RR fixed time slice round robin scheduling T1 T2 T3

16 4. Soft-Real-Time Scheduling Runqueue Priority Queues Priority Bitmap Allows finding the highest priority task in O(1) 0 0 T2 FIFO 7 T0 RR 9 T1 RR 7 T4 RR 9 T5 RR 9 99 Priority Queues One task queue for each priority 99 T3 FIFO 12

17 5. Load Balancing CFS Scheduling Domains CFS load balancing is used to offload task from busy CPUs to less busy or idle ones on SMP Systems. Domain Specific Balancing Policy how often to do balancing how far to move tasks how long before cache cools down Scheduling Domains Handle the topology variety of modern processor.

18 5. Load Balancing CFS Active and Idle Balancing kernel/sched_fair.c Balancing walks up the domain hierarchy and looks for the busiest group Active Balancing regularly by scheduler_tick() pulls tasks over from busiest group per domain Idle Balancing as soon as CPU goes idle in schedule() checks if average idle time is larger than migration cost pulling tasks like active balancing

19 5. Load Balancing CFS Where To Put a New Task kernel/sched.c select_task_rq(flag) { sched_class->select_task_rq(flag) } kernel/sched_fair.c fair_sched_class select_task_rq_fair(flag) { } SD_BALANCE_EXEC used in sched_exec() upon starting a new task with exec() SD_BALANCE_FORK Returns optimal CPU to put the task on used in wake_up_new_task() upon a fork command Looks for idlest CPU considering only those domains that have flag set in their balancing policy SD_BALANCE_WAKE used in try_to_wake_up() upon waking up a task that already ran

20 6. Load Balancing RT Root Domains and CPU Pri RT load balancing aims to make sure that the N highest priority tasks on the system are running at all time where N is the number of CPUs. struct root_domain struct cpupri overload mask CPU Pri CPU 0 CPU 1 CPU 2 CPU 3 Root Domain scope for RT scheduling decisions overall overload and priority state

21 6. Load Balancing RT Push A Low Priority Task is Pushed to Another CPU If post_schedule() lower prio task wakes up on CPU with higher prio task running higher prio task wakes up on CPU and preempts lower prio task T2 needs to be pushed away get CPU Lowest Mask represents the lowest priority tasks in the system Elect best target CPU based on cache affinity and topology CPU 4 94 CPU 0 84 CPU 2 87 T2 93 CPU 7 84

22 6. Load Balancing RT Pull A High Priority Task is Pulled from Another CPU If pre_schedule() priority of task to be scheduled would be lower than previously one s T0 89 prev CPU 0 85 CPU 1 90 T1 85 T2 90 T3 87 T4 83 next Pulled over

23 Linux Process Scheduling Thanks, Questions? sched.c schedule() scheduler_tick() try_to_wake_up() hooks RT CPU 0 CPU 1 CFS CPU 2 CPU 3

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

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

Process Scheduling II

Process Scheduling II Process Scheduling II COMS W4118 Prof. Kaustubh R. Joshi krj@cs.columbia.edu hdp://www.cs.columbia.edu/~krj/os References: OperaWng Systems Concepts (9e), Linux Kernel Development, previous W4118s Copyright

More information

Process Scheduling in Linux

Process Scheduling in Linux Process Scheduling in Linux This document contains notes about how the Linux kernel handles process scheduling. They cover the general scheduler skeleton, scheduling classes, the completely fair scheduling

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

Process Scheduling in Linux

Process Scheduling in Linux The Gate of the AOSP #4 : Gerrit, Memory & Performance Process Scheduling in Linux 2013. 3. 29 Namhyung Kim Outline 1 Process scheduling 2 SMP scheduling 3 Group scheduling - www.kandroid.org 2/ 41 Process

More information

EECS 750: Advanced Operating Systems. 01/28 /2015 Heechul Yun

EECS 750: Advanced Operating Systems. 01/28 /2015 Heechul Yun EECS 750: Advanced Operating Systems 01/28 /2015 Heechul Yun 1 Recap: Completely Fair Scheduler(CFS) Each task maintains its virtual time V i = E i 1 w i, where E is executed time, w is a weight Pick the

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

Linux O(1) CPU Scheduler. Amit Gud amit (dot) gud (at) veritas (dot) com http://amitgud.tk

Linux O(1) CPU Scheduler. Amit Gud amit (dot) gud (at) veritas (dot) com http://amitgud.tk Linux O(1) CPU Scheduler Amit Gud amit (dot) gud (at) veritas (dot) com http://amitgud.tk April 27, 2005 Agenda CPU scheduler basics CPU scheduler algorithms overview Linux CPU scheduler goals What is

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

Process Scheduling in Linux

Process Scheduling in Linux Process Scheduling in Linux Scheduling Mechanism: how to switch. Scheduling Policy: when to switch and what process to choose. Some scheduling objectives: fast process response time avoidance of process

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

Linux Load Balancing

Linux Load Balancing Linux Load Balancing Hyunmin Yoon 2 Load Balancing Linux scheduler attempts to evenly distribute load across CPUs Load of CPU (run queue): sum of task weights Load balancing is triggered by Timer interrupts

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

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

Chapter 5 Linux Load Balancing Mechanisms

Chapter 5 Linux Load Balancing Mechanisms Chapter 5 Linux Load Balancing Mechanisms Load balancing mechanisms in multiprocessor systems have two compatible objectives. One is to prevent processors from being idle while others processors still

More information

Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm

Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm PURPOSE Getting familiar with the Linux kernel source code. Understanding process scheduling and how different parameters

More information

ò Scheduling overview, key trade-offs, etc. ò O(1) scheduler older Linux scheduler ò Today: Completely Fair Scheduler (CFS) new hotness

ò Scheduling overview, key trade-offs, etc. ò O(1) scheduler older Linux scheduler ò Today: Completely Fair Scheduler (CFS) new hotness Last time Scheduling overview, key trade-offs, etc. O(1) scheduler older Linux scheduler Scheduling, part 2 Don Porter CSE 506 Today: Completely Fair Scheduler (CFS) new hotness Other advanced scheduling

More information

Hard Real-Time Linux

Hard Real-Time Linux Hard Real-Time Linux (or: How to Get RT Performances Using Linux) Andrea Bastoni University of Rome Tor Vergata System Programming Research Group bastoni@sprg.uniroma2.it Linux Kernel Hacking Free Course

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

Effective Computing with SMP Linux

Effective Computing with SMP Linux Effective Computing with SMP Linux Multi-processor systems were once a feature of high-end servers and mainframes, but today, even desktops for personal use have multiple processors. Linux is a popular

More information

Job Scheduling Model

Job Scheduling Model Scheduling 1 Job Scheduling Model problem scenario: a set of jobs needs to be executed using a single server, on which only one job at a time may run for theith job, we have an arrival timea i and a run

More information

Linux Scheduler Analysis and Tuning for Parallel Processing on the Raspberry PI Platform. Ed Spetka Mike Kohler

Linux Scheduler Analysis and Tuning for Parallel Processing on the Raspberry PI Platform. Ed Spetka Mike Kohler Linux Scheduler Analysis and Tuning for Parallel Processing on the Raspberry PI Platform Ed Spetka Mike Kohler Outline Abstract Hardware Overview Completely Fair Scheduler Design Theory Breakdown of the

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

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

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

Task Scheduling for Multicore Embedded Devices

Task Scheduling for Multicore Embedded Devices Embedded Linux Conference 2013 Task Scheduling for Multicore Embedded Devices 2013. 02. 22. Gap-Joo Na (funkygap@etri.re.kr) Contents 2 What is multicore?? 1. Multicore trends 2. New Architectures 3. Software

More information

A Survey of Parallel Processing in Linux

A Survey of Parallel Processing in Linux A Survey of Parallel Processing in Linux Kojiro Akasaka Computer Science Department San Jose State University San Jose, CA 95192 408 924 1000 kojiro.akasaka@sjsu.edu ABSTRACT Any kernel with parallel processing

More information

Scheduling policy. ULK3e 7.1. Operating Systems: Scheduling in Linux p. 1

Scheduling policy. ULK3e 7.1. Operating Systems: Scheduling in Linux p. 1 Scheduling policy ULK3e 7.1 Goals fast process response time good throughput for background jobs avoidance of process starvation reconciliation of needs of low- and high-priority processes Operating Systems:

More information

Multilevel Load Balancing in NUMA Computers

Multilevel Load Balancing in NUMA Computers FACULDADE DE INFORMÁTICA PUCRS - Brazil http://www.pucrs.br/inf/pos/ Multilevel Load Balancing in NUMA Computers M. Corrêa, R. Chanin, A. Sales, R. Scheer, A. Zorzo Technical Report Series Number 049 July,

More information

Scheduling Support for Heterogeneous Hardware Accelerators under Linux

Scheduling Support for Heterogeneous Hardware Accelerators under Linux Scheduling Support for Heterogeneous Hardware Accelerators under Linux Tobias Wiersema University of Paderborn Paderborn, December 2010 1 / 24 Tobias Wiersema Linux scheduler extension for accelerators

More information

Linux Scheduler. Linux Scheduler

Linux Scheduler. Linux Scheduler or or Affinity Basic Interactive es 1 / 40 Reality... or or Affinity Basic Interactive es The Linux scheduler tries to be very efficient To do that, it uses some complex data structures Some of what it

More information

Comparing Power Saving Techniques for Multi cores ARM Platforms

Comparing Power Saving Techniques for Multi cores ARM Platforms Comparing Power Saving Techniques for Multi cores ARM Platforms Content Why to use CPU hotplug? Tests environment CPU hotplug constraints What we have / What we want How to

More information

Modular Real-Time Linux

Modular Real-Time Linux Modular Real-Time Linux Shinpei Kato Department of Information and Computer Science, Keio University 3-14-1 Hiyoshi, Kohoku, Yokohama, Japan shinpei@ny.ics.keio.ac.jp Nobuyuki Yamasaki Department of Information

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

Update on big.little scheduling experiments. Morten Rasmussen Technology Researcher

Update on big.little scheduling experiments. Morten Rasmussen Technology Researcher Update on big.little scheduling experiments Morten Rasmussen Technology Researcher 1 Agenda Why is big.little different from SMP? Summary of previous experiments on emulated big.little. New results for

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

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

Improvement of Scheduling Granularity for Deadline Scheduler

Improvement of Scheduling Granularity for Deadline Scheduler Improvement of Scheduling Granularity for Deadline Scheduler Yoshitake Kobayashi Advanced Software Technology Group Corporate Software Engineering Center TOSHIBA CORPORATION Copyright 2012, Toshiba Corporation.

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

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

An Adaptive Task-Core Ratio Load Balancing Strategy for Multi-core Processors

An Adaptive Task-Core Ratio Load Balancing Strategy for Multi-core Processors An Adaptive Task-Core Ratio Load Balancing Strategy for Multi-core Processors Ian K. T. Tan, Member, IACSIT, Chai Ian, and Poo Kuan Hoong Abstract With the proliferation of multi-core processors in servers,

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

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

POWER EFFICIENT SCHEDULING FOR

POWER EFFICIENT SCHEDULING FOR POWER EFFICIENT SCHEDULING FOR A CLOUD SYSTEM Joachim Sjöblom Master of Science Thesis Supervisor: Prof. Johan Lilius Advisor: Dr. Sébastien Lafond Embedded Systems Laboratory Department of Information

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

A complete guide to Linux process scheduling. Nikita Ishkov

A complete guide to Linux process scheduling. Nikita Ishkov A complete guide to Linux process scheduling Nikita Ishkov University of Tampere School of Information Sciences Computer Science M.Sc. Thesis Supervisor: Martti Juhola February 2015 University of Tampere

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

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

CFS-v: I/O Demand-driven VM Scheduler in KVM

CFS-v: I/O Demand-driven VM Scheduler in KVM CFS-v: Demand-driven VM Scheduler in KVM Hyotaek Shim and Sung-Min Lee (hyotaek.shim, sung.min.lee@samsung.- com) Software R&D Center, Samsung Electronics 2014. 10. 16 Problem in Server Consolidation 2/16

More information

Scheduling and Kernel Synchronization

Scheduling and Kernel Synchronization 7 Scheduling and Kernel Synchronization In this chapter 7.1 Linux Scheduler 375 7.2 Preemption 405 7.3 Spinlocks and Semaphores 409 7.4 System Clock: Of Time and Timers 411 Summary 418 Exercises 419 373

More information

Power Management in the Linux Kernel

Power Management in the Linux Kernel Power Management in the Linux Kernel Tate Hornbeck, Peter Hokanson 7 April 2011 Intel Open Source Technology Center Venkatesh Pallipadi Senior Staff Software Engineer 2001 - Joined Intel Processor and

More information

Lottery scheduler for the Linux kernel. Planificador lotería para el núcleo de Linux

Lottery scheduler for the Linux kernel. Planificador lotería para el núcleo de Linux Lottery scheduler for the Linux kernel María Mejía a, Adriana Morales-Betancourt b & Tapasya Patki c a Universidad de Caldas and Universidad Nacional de Colombia, Manizales, Colombia, mariah.mejia@ucaldas.edu.co

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

Linux Plumbers 2010. API for Real-Time Scheduling with Temporal Isolation on Linux

Linux Plumbers 2010. API for Real-Time Scheduling with Temporal Isolation on Linux Linux Plumbers 2010 November 3rd, Boston API for Real-Time Scheduling with Temporal Isolation on Linux Tommaso Cucinotta, Cucinotta, Dhaval Giani, Dario Faggioli, Fabio Checconi Real-Time Systems Lab (RETIS)

More information

SYSTEM ecos Embedded Configurable Operating System

SYSTEM ecos Embedded Configurable Operating System BELONGS TO THE CYGNUS SOLUTIONS founded about 1989 initiative connected with an idea of free software ( commercial support for the free software ). Recently merged with RedHat. CYGNUS was also the original

More information

Load-Balancing for Improving User Responsiveness on Multicore Embedded Systems

Load-Balancing for Improving User Responsiveness on Multicore Embedded Systems Load-Balancing for Improving User Responsiveness on Multicore Embedded Systems 2012 Linux Symposium Geunsik Lim Sungkyungkwan University Samsung Electronics leemgs@ece.skku.ac.kr geunsik.lim@samsung.com

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

The Role of Load Balancing and High Performance Process Schematics

The Role of Load Balancing and High Performance Process Schematics 1 A Dynamic Scheduler for Balancing HPC Applications Carlos Boneti, Roberto Gioiosa, Francisco J. Cazorla, Mateo Valero Barcelona Supercomputing Center, Spain Universitat Politecnica de Catalunya, Spain

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

Advanced topics: reentrant function

Advanced topics: reentrant function COSC 6374 Parallel Computation Advanced Topics in Shared Memory Programming Edgar Gabriel Fall 205 Advanced topics: reentrant function Functions executed in a multi-threaded environment need to be re-rentrant

More information

Main Points. Scheduling policy: what to do next, when there are multiple threads ready to run. Definitions. Uniprocessor policies

Main Points. Scheduling policy: what to do next, when there are multiple threads ready to run. Definitions. Uniprocessor policies Scheduling Main Points Scheduling policy: what to do next, when there are multiple threads ready to run Or multiple packets to send, or web requests to serve, or Definitions response time, throughput,

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

Why Computers Are Getting Slower (and what we can do about it) Rik van Riel Sr. Software Engineer, Red Hat

Why Computers Are Getting Slower (and what we can do about it) Rik van Riel Sr. Software Engineer, Red Hat Why Computers Are Getting Slower (and what we can do about it) Rik van Riel Sr. Software Engineer, Red Hat Why Computers Are Getting Slower The traditional approach better performance Why computers are

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

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

The Linux Kernel: Process Management. CS591 (Spring 2001)

The Linux Kernel: Process Management. CS591 (Spring 2001) The Linux Kernel: Process Management Process Descriptors The kernel maintains info about each process in a process descriptor, of type task_struct. See include/linux/sched.h Each process descriptor contains

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

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

Using EDF in Linux: SCHED DEADLINE. Luca Abeni luca.abeni@unitn.it

Using EDF in Linux: SCHED DEADLINE. Luca Abeni luca.abeni@unitn.it Using EDF in Linux: Luca Abeni luca.abeni@unitn.it Using Fixed Priorities in Linux SCHED FIFO and SCHED RR use fixed priorities They can be used for real-time tasks, to implement RM and DM Real-time tasks

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

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

An EDF scheduling class for the Linux kernel

An EDF scheduling class for the Linux kernel An EDF scheduling class for the Linux kernel Dario Faggioli, Fabio Checconi Scuola Superiore Sant Anna Pisa, Italy {d.faggioli, f.checconi}@sssup.it Michael Trimarchi, Claudio Scordino Evidence Srl Pisa,

More information

Scheduling. Monday, November 22, 2004

Scheduling. Monday, November 22, 2004 Scheduling Page 1 Scheduling Monday, November 22, 2004 11:22 AM The scheduling problem (Chapter 9) Decide which processes are allowed to run when. Optimize throughput, response time, etc. Subject to constraints

More information

Tasks Schedule Analysis in RTAI/Linux-GPL

Tasks Schedule Analysis in RTAI/Linux-GPL Tasks Schedule Analysis in RTAI/Linux-GPL Claudio Aciti and Nelson Acosta INTIA - Depto de Computación y Sistemas - Facultad de Ciencias Exactas Universidad Nacional del Centro de la Provincia de Buenos

More information

Load-Balancing for a Real-Time System Based on Asymmetric Multi-Processing

Load-Balancing for a Real-Time System Based on Asymmetric Multi-Processing LIFL Report # 2004-06 Load-Balancing for a Real-Time System Based on Asymmetric Multi-Processing Éric PIEL Eric.Piel@lifl.fr Philippe MARQUET Philippe.Marquet@lifl.fr Julien SOULA Julien.Soula@lifl.fr

More information

Scheduling Algorithms

Scheduling Algorithms Scheduling Algorithms List Pros and Cons for each of the four scheduler types listed below. First In First Out (FIFO) Simplicity FIFO is very easy to implement. Less Overhead FIFO will allow the currently

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

Understanding Linux on z/vm Steal Time

Understanding Linux on z/vm Steal Time Understanding Linux on z/vm Steal Time June 2014 Rob van der Heij rvdheij@velocitysoftware.com Summary Ever since Linux distributions started to report steal time in various tools, it has been causing

More information

Agenda. Context. System Power Management Issues. Power Capping Overview. Power capping participants. Recommendations

Agenda. Context. System Power Management Issues. Power Capping Overview. Power capping participants. Recommendations Power Capping Linux Agenda Context System Power Management Issues Power Capping Overview Power capping participants Recommendations Introduction of Linux Power Capping Framework 2 Power Hungry World Worldwide,

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

Multi-core and Linux* Kernel

Multi-core and Linux* Kernel Multi-core and Linux* Kernel Suresh Siddha Intel Open Source Technology Center Abstract Semiconductor technological advances in the recent years have led to the inclusion of multiple CPU execution cores

More information

Linux process scheduling

Linux process scheduling Linux process scheduling David Morgan General neediness categories realtime processes whenever they demand attention, need it immediately other processes interactive care about responsiveness demand no

More information

Linux Audio Conference 2011

Linux Audio Conference 2011 Linux Audio Conference 2011 May 6-8 th, Maynooth Low-Latency Audio on Linux by Means of Real-Time Scheduling Tommaso Cucinotta,, Dario Faggioli, Giacomo Bagnoli Real-Time Systems Lab (RETIS) Scuola Superiore

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

Linux 2.6 (< 2.6.23) Scheduler. Administrivia. Linux task lists (continued) Linux task lists. Lottery scheduling [Waldspurger 94]

Linux 2.6 (< 2.6.23) Scheduler. Administrivia. Linux task lists (continued) Linux task lists. Lottery scheduling [Waldspurger 94] Administrivia Project 1 due Thursday 4:15pm - Show up to lecture for free extension to midnight - SCPD can just watch lecture before midnight If you need longer, email cs14-staff. - Put extension in the

More information

Long-term monitoring of apparent latency in PREEMPT RT Linux real-time systems

Long-term monitoring of apparent latency in PREEMPT RT Linux real-time systems Long-term monitoring of apparent latency in PREEMPT RT Linux real-time systems Carsten Emde Open Source Automation Development Lab (OSADL) eg Aichhalder Str. 39, 78713 Schramberg, Germany C.Emde@osadl.org

More information

Why Relative Share Does Not Work

Why Relative Share Does Not Work Why Relative Share Does Not Work Introduction Velocity Software, Inc March 2010 Rob van der Heij rvdheij @ velocitysoftware.com Installations that run their production and development Linux servers on

More information

Programming and Scheduling Model for Supporting Heterogeneous Architectures in Linux

Programming and Scheduling Model for Supporting Heterogeneous Architectures in Linux Programming and Scheduling Model for Supporting Heterogeneous Architectures in Linux Third Workshop on Computer Architecture and Operating System co-design Paris, 25.01.2012 Tobias Beisel, Tobias Wiersema,

More information

These sub-systems are all highly dependent on each other. Any one of them with high utilization can easily cause problems in the other.

These sub-systems are all highly dependent on each other. Any one of them with high utilization can easily cause problems in the other. Abstract: The purpose of this document is to describe how to monitor Linux operating systems for performance. This paper examines how to interpret common Linux performance tool output. After collecting

More information

Real-Time Performance and Middleware for Multiprocessor and Multicore Linux Platforms

Real-Time Performance and Middleware for Multiprocessor and Multicore Linux Platforms Real-Time Performance and Middleware for Multiprocessor and Multicore Linux Platforms Yuanfang Zhang, Christopher Gill and Chenyang Lu Department of Computer Science and Engineering, Washington University,

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

An Implementation Of Multiprocessor Linux

An Implementation Of Multiprocessor Linux An Implementation Of Multiprocessor Linux This document describes the implementation of a simple SMP Linux kernel extension and how to use this to develop SMP Linux kernels for architectures other than

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

Performance tuning Xen

Performance tuning Xen Performance tuning Xen Roger Pau Monné roger.pau@citrix.com Madrid 8th of November, 2013 Xen Architecture Control Domain NetBSD or Linux device model (qemu) Hardware Drivers toolstack netback blkback Paravirtualized

More information

Real-time KVM from the ground up

Real-time KVM from the ground up Real-time KVM from the ground up KVM Forum 2015 Rik van Riel Red Hat Real-time KVM What is real time? Hardware pitfalls Realtime preempt Linux kernel patch set KVM & qemu pitfalls KVM configuration Scheduling

More information

CPU bandwidth control for CFS

CPU bandwidth control for CFS CPU bandwidth control for CFS Paul Turner Google pjt@google.com Bharata B Rao IBM India Software Labs, Bangalore bharata@linux.vnet.ibm.com Nikhil Rao Google ncrao@google.com Abstract Over the past few

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

Implementation of ARTiS, an Asymmetric Real-Time Extension of SMP Linux

Implementation of ARTiS, an Asymmetric Real-Time Extension of SMP Linux Implementation of ARTiS, an Asymmetric Real-Time Extension of SMP Philippe Marquet, Éric Piel, Julien Soula, Jean-Luc Dekeyser To cite this version: Philippe Marquet, Éric Piel, Julien Soula, Jean-Luc

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