Linux Load Balancing

Size: px
Start display at page:

Download "Linux Load Balancing"

Transcription

1 Linux Load Balancing Hyunmin Yoon

2 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 Load balancing code is invoked periodically Scheduling events Load balancing code is executed when the CPU becomes idle fork() has been executed exec() has been executed a task has waken up 2

3 3 Scheduling Domains and Groups Scheduling domains Load balancing takes place within a scheduling domain Scheduling domains define the scheduling entities in a hierarchical fashion Each scheduling domain spans a number of CPUs A domain's span MUST be a superset of it child's span Each scheduling domain must have one or more scheduling groups Scheduling groups Each scheduling group contains one or more (virtual) CPUs Load balancing takes place between scheduling groups 3

4 4 CPU Topology 4

5 5 Scheduling Domain Default scheduling domain topology levels SMT domain: for multi-threading in a package ARM uses GMC domain MC domain: for multi-core in a package DIE domain: for multi-package Domains have different configuration Implies differences in flags SD_SHARE_PKG_RESOURCES Sharing resources like the cache between groups SD_SHARE_POWERDOMAIN Reflect whether groups of CPUs in a sched_domain level can or not reach different power state 5

6 6 Timer-Driven Load Balancing Load balancing is triggered by scheduling ticks kernel/sched/core.c Invoked by a timer interrupt Check if it is time to do load balancing kernel/sched/fair.c If it is time for load balancing, mark it for the softirq handler Perform load balancing 6

7 7 run_rebalance_domains() kernel/sched/fair.c 7

8 8 rebalance_domains() kernel/sched/fair.c static void rebalance_domains(struct rq *rq, enum cpu_idle_type idle) { unsigned long next_balance = jiffies + 60*HZ; int update_next_balance = 0; for_each_domain(cpu, sd) { Set the balancing interval for current domain interval = (the number of CPUs of this domain) x (busy factor = 32) milliseconds Check the balancing interval to see if the sched_domain should be rebalanced interval = get_sd_balance_interval(sd, idle!= CPU_IDLE); if (time_after_eq(jiffies, sd->last_balance + interval)) { if (load_balance(cpu, rq, sd, idle, &continue_balancing)) { idle = idle_cpu(cpu)? CPU_IDLE : CPU_NOT_IDLE; sd->last_balance = jiffies; interval = get_sd_balance_interval(sd, idle!= CPU_IDLE); if (time_after(next_balance, sd->last_balance + interval)) { next_balance = sd->last_balance + interval; update_next_balance = 1; Set the interval for periodic execution of load balancer 1 minute Starting from the current domain All parent domains are visited 8

9 9 Default Load Balancing Method Find a busiest group that has highest group average load in a domain Find a busiest run-queue that has highest run-queue load in the busiest group Pull tasks from the busiest run-queue to run-queue calling load balancer Domain Domain Group 1 Group 2 Busiest Group Group 1 Group 2 migration RQ1 RQ2 RQ3 RQ4 Call Load Balancer RQ1 RQ2 RQ3 RQ4 Busiest run-queue 9

10 10 Domain Load load_balance() -> find_busiest_group() -> update_sd_lb_stats(); static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sds) { struct sched_domain *child = env->sd->child; struct sched_group *sg = env->sd->groups; do { struct sg_lb_stats *sgs = &tmp_sgs; int local_group; local_group = cpumask_test_cpu(env->dst_cpu, sched_group_cpus(sg)); if (local_group) { sds->local = sg; sgs = &sds->local_stat; if (env->idle!= CPU_NEWLY_IDLE time_after_eq(jiffies, sg->sgc->next_update)) update_group_capacity(env->sd, env->dst_cpu); update_sg_lb_stats(env, sg, load_idx, local_group, sgs, &overload); if (local_group) goto next_group; next_group: if (update_sd_pick_busiest(env, sds, sg, sgs)) { sds->busiest = sg; sds->busiest_stat = *sgs; sds->total_load += sgs->group_load; sds->total_capacity += sgs->group_capacity; sg = sg->next; while (sg!= env->sd->groups); designate local group (= current group) and update group capacity update group load information calculate domain load and pick busiest group in the domain 10

11 11 Group Load load_balance() -> find_busiest_group() -> update_sd_lb_stats(); -> update_sg_lb_stats(); static inline void update_sg_lb_stats(struct lb_env *env, struct sched_group *group, int load_idx, int local_group, struct sg_lb_stats *sgs, bool *overload) { for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { struct rq *rq = cpu_rq(i); if (local_group) load = target_load(i, load_idx); else load = source_load(i, load_idx); sgs->group_load += load; sgs->sum_nr_running += rq->nr_running; if (rq->nr_running > 1) *overload = true; sgs->sum_weighted_load += weighted_cpuload(i); if (idle_cpu(i)) sgs->idle_cpus++; sgs->group_capacity = group->sgc->capacity; sgs->avg_load = (sgs->group_load*sched_capacity_scale) / sgs->group_capacity; if (sgs->sum_nr_running) sgs->load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; sgs->group_weight = group->group_weight; sgs->group_imb = sg_imbalanced(group); sgs->group_capacity_factor = sg_capacity_factor(env, group); if (sgs->group_capacity_factor > sgs->sum_nr_running) sgs->group_has_free_capacity = 1; 11

12 12 calculate_imbalance() static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *sds) { unsigned long max_pull, load_above_capacity = ~0UL; struct sg_lb_stats *local, *busiest; local = &sds->local_stat; busiest = &sds->busiest_stat; if (busiest->avg_load <= sds->avg_load local->avg_load >= sds->avg_load) { env->imbalance = 0; return fix_small_imbalance(env, sds); if (!busiest->group_imb) { load_above_capacity = (busiest->sum_nr_running - busiest->group_capacity_factor); load_above_capacity *= (SCHED_LOAD_SCALE * SCHED_CAPACITY_SCALE); load_above_capacity /= busiest->group_capacity; max_pull = min(busiest->avg_load - sds->avg_load, load_above_capacity); env->imbalance = min( max_pull * busiest->group_capacity, (sds->avg_load - local->avg_load) * local->group_capacity ) / SCHED_CAPACITY_SCALE; 12

13 13 Out Balancing Condition Many out balancing conditions exist in load balancer ex) The imbalance is within the specified limit in find_busiest_group() if (env->idle == CPU_IDLE) { if ((local->idle_cpus < busiest->idle_cpus) && busiest->sum_nr_running <= busiest->group_weight) goto out_balanced; else { if (100 * busiest->avg_load <= env->sd->imbalance_pct * local->avg_load) goto out_balanced; Default = 125% case of setting SD_SHARE_CPUCAPACITY = 110% case of setting SD_SHARE_PKG_RESOURCES = 117% case of NUMA migration = 112% 13

14 14 Choosing the Tasks load_balance() looks for tasks Inactive (likely to be cache cold) load_balance() skips tasks that are Likely to be cache warm Currently running on a CPU Not allowed to run on the current CPU (as indicated by the cpus_allowed bitmask in the task_struct) 14

15 15 Handling Imbalance after Load Balancing If load balancer failed many times to move load, it sets active_balance active_balance uses push mechanism to avoid physical/logical imbalance active_load_balance_cpu_stop() pushes one task from busiest CPU to idle CPU even though busiest CPU has only one task If active_balance was set, load balancer doesn t need to work at next interval because it is covered by push mechanism 15

16 16 Event-Driven Load Balancing Event-driven load balancing is performed by setting flags include/linux/sched.h #define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */ #define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ #define SD_BALANCE_EXEC 0x0004 /* Balance on exec */ #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ When a task is newly created or woke up via fork(), exec(), wakeup() Select the least loaded group in its current domain Move the task to the least loaded CPU When the CPU becomes newly idle Select the most loaded group in its current domain Move tasks from the most loaded CPU to this CPU 16

17 17 Tickless Idle Traditional systems use a periodic interrupt 'tick' Update the system clock Tick requires wakeup from idle state Tickless idle eliminates the periodic timer tick when the CPU is idle The CPU can remain in power saving states for a longer period of time, reducing the overall system power consumption 17

18 18 18

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

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

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

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

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

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

Linux Process Scheduling. sched.c. schedule() scheduler_tick() hooks. try_to_wake_up() ... CFS CPU 0 CPU 1 CPU 2 CPU 3 Linux Process Scheduling sched.c schedule() scheduler_tick() try_to_wake_up() hooks RT CPU 0 CPU 1 CFS CPU 2 CPU 3 Linux Process Scheduling 1. Task Classification 2. Scheduler Skeleton 3. Completely Fair

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

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

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

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

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

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

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

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

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

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

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

ò 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

Overview of the Current Approaches to Enhance the Linux Scheduler. Preeti U. Murthy preeti@linux.vnet.ibm.com IBM Linux Technology Center

Overview of the Current Approaches to Enhance the Linux Scheduler. Preeti U. Murthy preeti@linux.vnet.ibm.com IBM Linux Technology Center Overview of the Current Approaches to Enhance the Linux Scheduler Preeti U. Murthy preeti@linux.vnet.ibm.com IBM Linux Technology Center Linux Foundation Collaboration Summit San Francisco,CA 16 April,

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

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

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

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

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

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

STEPPING TOWARDS A NOISELESS LINUX ENVIRONMENT

STEPPING TOWARDS A NOISELESS LINUX ENVIRONMENT ROSS 2012 June 29 2012 Venice, Italy STEPPING TOWARDS A NOISELESS LINUX ENVIRONMENT Hakan Akkan*, Michael Lang, Lorie Liebrock* Presented by: Abhishek Kulkarni * New Mexico Tech Ultrascale Systems Research

More information

Scheduling in The Age of Virtualization

Scheduling in The Age of Virtualization Scheduling in The Age of Virtualization Dario Faggioli dario.faggioli@citrix.com Bruxelles 30th of January, 2016 Welcome Hello, my name is Dario I m with Citrix since 2011 (in the Xen Platform Team) Bruxelles

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

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

A Study of Performance Monitoring Unit, perf and perf_events subsystem

A Study of Performance Monitoring Unit, perf and perf_events subsystem A Study of Performance Monitoring Unit, perf and perf_events subsystem Team Aman Singh Anup Buchke Mentor Dr. Yann-Hang Lee Summary Performance Monitoring Unit, or the PMU, is found in all high end processors

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 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

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

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

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

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

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

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

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

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 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

Getting maximum mileage out of tickless

Getting maximum mileage out of tickless Getting maximum mileage out of tickless Suresh Siddha Venkatesh Pallipadi Arjan Van De Ven Intel Open Source Technology Center {suresh.b.siddha venkatesh.pallipadi arjan.van.de.ven}@intel.com Abstract

More information

IO latency tracking. Daniel Lezcano (dlezcano) Linaro Power Management Team

IO latency tracking. Daniel Lezcano (dlezcano) Linaro Power Management Team IO latency tracking Daniel Lezcano (dlezcano) Linaro Power Management Team CPUIDLE CPUidle is a framework divided into three parts: The generic framework The back-end driver: low level calls or hidden

More information

Migration of Process Credentials

Migration of Process Credentials C H A P T E R - 5 Migration of Process Credentials 5.1 Introduction 5.2 The Process Identifier 5.3 The Mechanism 5.4 Concluding Remarks 100 CHAPTER 5 Migration of Process Credentials 5.1 Introduction Every

More information

Multi-Threading Performance on Commodity Multi-Core Processors

Multi-Threading Performance on Commodity Multi-Core Processors Multi-Threading Performance on Commodity Multi-Core Processors Jie Chen and William Watson III Scientific Computing Group Jefferson Lab 12000 Jefferson Ave. Newport News, VA 23606 Organization Introduction

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

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

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

Kernel Synchronization and Interrupt Handling

Kernel Synchronization and Interrupt Handling Kernel Synchronization and Interrupt Handling Oliver Sengpie, Jan van Esdonk Arbeitsbereich Wissenschaftliches Rechnen Fachbereich Informatik Fakultt fr Mathematik, Informatik und Naturwissenschaften Universitt

More information

Energy-aware Memory Management through Database Buffer Control

Energy-aware Memory Management through Database Buffer Control Energy-aware Memory Management through Database Buffer Control Chang S. Bae, Tayeb Jamel Northwestern Univ. Intel Corporation Presented by Chang S. Bae Goal and motivation Energy-aware memory management

More information

RIOS: A Lightweight Task Scheduler for Embedded Systems

RIOS: A Lightweight Task Scheduler for Embedded Systems RIOS: A Lightweight Task Scheduler for Embedded Systems Bailey Miller*, Frank Vahid*, Tony Givargis *Dept. Computer Science & Engineering University of California, Riverside {chuang,bmiller,vahid@cs.ucr.edu

More information

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY. 6.828 Operating System Engineering: Fall 2005

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY. 6.828 Operating System Engineering: Fall 2005 Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.828 Operating System Engineering: Fall 2005 Quiz II Solutions Average 84, median 83, standard deviation

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

Beyond the Hypervisor

Beyond the Hypervisor Beyond the Hypervisor A Technical Roadmap for Open Virtualization, Linux, KVM Mike Day Distinguished Engineer, Chief Virtualization Architect, Open Systems Development Saturday, February 22, 2014 1 mdday@us.ibm.com

More information

Jorix kernel: real-time scheduling

Jorix kernel: real-time scheduling Jorix kernel: real-time scheduling Joris Huizer Kwie Min Wong May 16, 2007 1 Introduction As a specialized part of the kernel, we implemented two real-time scheduling algorithms: RM (rate monotonic) and

More information

Process definition Concurrency Process status Process attributes PROCESES 1.3

Process definition Concurrency Process status Process attributes PROCESES 1.3 Process Management Outline Main concepts Basic services for process management (Linux based) Inter process communications: Linux Signals and synchronization Internal process management Basic data structures:

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

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

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

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University Multitasking ARM-Applications with uvision and RTX 1. Objectives The purpose of this lab is to lab is to introduce

More information

Linux Kernel Networking. Raoul Rivas

Linux Kernel Networking. Raoul Rivas Linux Kernel Networking Raoul Rivas Kernel vs Application Programming No memory protection Memory Protection We share memory with devices, scheduler Sometimes no preemption Can hog the CPU Segmentation

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

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,

More information

Sistemi Operativi. Lezione 25: JOS processes (ENVS) Corso: Sistemi Operativi Danilo Bruschi A.A. 2015/2016

Sistemi Operativi. Lezione 25: JOS processes (ENVS) Corso: Sistemi Operativi Danilo Bruschi A.A. 2015/2016 Sistemi Operativi Lezione 25: JOS processes (ENVS) 1 JOS PCB (ENV) 2 env_status ENV_FREE: Indicates that the Env structure is inactive, and therefore on the env_free_list. ENV_RUNNABLE: Indicates that

More information

The Linux Scheduler: a Decade of Wasted Cores

The Linux Scheduler: a Decade of Wasted Cores The Linux Scheduler: a Decade of Wasted Cores Jean-Pierre Lozi Université Nice Sophia-Antipolis jplozi@unice.fr Fabien Gaud Coho Data me@fabiengaud.net Baptiste Lepers EPFL baptiste.lepers@epfl.ch Vivien

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

STUDY OF PERFORMANCE COUNTERS AND PROFILING TOOLS TO MONITOR PERFORMANCE OF APPLICATION

STUDY OF PERFORMANCE COUNTERS AND PROFILING TOOLS TO MONITOR PERFORMANCE OF APPLICATION STUDY OF PERFORMANCE COUNTERS AND PROFILING TOOLS TO MONITOR PERFORMANCE OF APPLICATION 1 DIPAK PATIL, 2 PRASHANT KHARAT, 3 ANIL KUMAR GUPTA 1,2 Depatment of Information Technology, Walchand College of

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

MPLAB Harmony System Service Libraries Help

MPLAB Harmony System Service Libraries Help MPLAB Harmony System Service Libraries Help MPLAB Harmony Integrated Software Framework v1.08 All rights reserved. This section provides descriptions of the System Service libraries that are available

More information

On the implementation of real-time slot-based task-splitting scheduling algorithms for multiprocessor systems

On the implementation of real-time slot-based task-splitting scheduling algorithms for multiprocessor systems On the implementation of real-time slot-based task-splitting scheduling algorithms for multiprocessor systems Paulo Baltarejo Sousa CISTER-ISEP Research Center, Polytechnic Institute of Porto Rua Dr. António

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

The CPU Scheduler in VMware vsphere 5.1

The CPU Scheduler in VMware vsphere 5.1 VMware vsphere 5.1 Performance Study TECHNICAL WHITEPAPER Table of Contents Executive Summary... 4 Introduction... 4 Terminology... 4 CPU Scheduler Overview... 5 Design Goals... 5 What, When, and Where

More information

How To Save Power On A Server With A Power Management System On A Vsphere Vsphee V2.2.1.2 (Vsphere) Vspheer (Vpower) (Vesphere) (Vmware

How To Save Power On A Server With A Power Management System On A Vsphere Vsphee V2.2.1.2 (Vsphere) Vspheer (Vpower) (Vesphere) (Vmware Best Practices for Performance Tuning of Latency-Sensitive Workloads in vsphere VMs TECHNICAL WHITE PAPER Table of Contents Introduction... 3 BIOS Settings... 3 NUMA... 4 Choice of Guest OS... 5 Physical

More information

Performance Evaluation of a Multilevel Load Balancing Algorithm

Performance Evaluation of a Multilevel Load Balancing Algorithm FACULDADE DE INFORMÁTICA PUCRS - Brazil http://www.pucrs.br/inf/pos/ Performance Evaluation of a Multilevel Load Balancing Algorithm M. Corrêa, R. Chanin, A. Sales, R. Scheer, A. Zorzo TECHNICAL REPORT

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

Dispatching Domains for Multiprocessor Platforms and their Representation in Ada

Dispatching Domains for Multiprocessor Platforms and their Representation in Ada Reliable Software Technology p. 1/26 Dispatching Domains for Multiprocessor Platforms and their Representation in Ada Alan Burns and Andy Wellings Reliable Software Technology p. 2/26 Motivation Multiprocessor

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

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

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

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

Domains. Seminar on High Availability and Timeliness in Linux. Zhao, Xiaodong March 2003 Department of Computer Science University of Helsinki

Domains. Seminar on High Availability and Timeliness in Linux. Zhao, Xiaodong March 2003 Department of Computer Science University of Helsinki Domains Seminar on High Availability and Timeliness in Linux Zhao, Xiaodong March 2003 Department of Computer Science University of Helsinki 1 1. Introduction The Hardware Platform Interface (HPI) is developed

More information

Quantum Support for Multiprocessor Pfair Scheduling in Linux

Quantum Support for Multiprocessor Pfair Scheduling in Linux Quantum Support for Multiprocessor fair Scheduling in Linux John M. Calandrino and James H. Anderson Department of Computer Science, The University of North Carolina at Chapel Hill Abstract This paper

More information

Energy-aware task and interrupt management in Linux

Energy-aware task and interrupt management in Linux Energy-aware task and interrupt management in Linux Vaidyanathan Srinivasan, Gautham R Shenoy, Srivatsa Vaddagiri, Dipankar Sarma IBM Linux Technology Center {svaidy, vatsa}@linux.vnet.ibm.com, {ego, dipankar}@in.ibm.com

More information

Multi-core architectures. Jernej Barbic 15-213, Spring 2007 May 3, 2007

Multi-core architectures. Jernej Barbic 15-213, Spring 2007 May 3, 2007 Multi-core architectures Jernej Barbic 15-213, Spring 2007 May 3, 2007 1 Single-core computer 2 Single-core CPU chip the single core 3 Multi-core architectures This lecture is about a new trend in computer

More information

Linux on POWER for Green Data Center

Linux on POWER for Green Data Center Linux on POWER for Green Data Center Vaidyanathan Srinivasan IBM India Systems and Technology Labs Agenda POWER platform energy management features Linux OS energy management

More information

HUAWEI OceanStor 9000. Load Balancing Technical White Paper. Issue 01. Date 2014-06-20 HUAWEI TECHNOLOGIES CO., LTD.

HUAWEI OceanStor 9000. Load Balancing Technical White Paper. Issue 01. Date 2014-06-20 HUAWEI TECHNOLOGIES CO., LTD. HUAWEI OceanStor 9000 Load Balancing Technical Issue 01 Date 2014-06-20 HUAWEI TECHNOLOGIES CO., LTD. Copyright Huawei Technologies Co., Ltd. 2014. All rights reserved. No part of this document may be

More information

Understanding the Linux 2.6.8.1 CPU Scheduler

Understanding the Linux 2.6.8.1 CPU Scheduler Understanding the Linux 2.6.8.1 CPU Scheduler By Josh Aas c 2005 Silicon Graphics, Inc. (SGI) 17th February 2005 Contents 1 Introduction 3 1.1 Paper Overview............................ 3 1.2 Linux Kernel

More information

Performance Testing for GDB

Performance Testing for GDB Performance Testing for GDB Yao Qi yao@codesourcery.com CodeSourcery/MentorGraphics 214-9-13 1 Overview Introduction Goals 2 3 Introduction Goals Introduction We need something to test and measure GDB

More information

C++FA 5.1 PRACTICE MID-TERM EXAM

C++FA 5.1 PRACTICE MID-TERM EXAM C++FA 5.1 PRACTICE MID-TERM EXAM This practicemid-term exam covers sections C++FA 1.1 through C++FA 1.4 of C++ with Financial Applications by Ben Van Vliet, available at www.benvanvliet.net. 1.) A pointer

More information

Scaling Networking Applications to Multiple Cores

Scaling Networking Applications to Multiple Cores Scaling Networking Applications to Multiple Cores Greg Seibert Sr. Technical Marketing Engineer Cavium Networks Challenges with multi-core application performance Amdahl s Law Evaluates application performance

More information

Virtual Servers. Virtual machines. Virtualization. Design of IBM s VM. Virtual machine systems can give everyone the OS (and hardware) that they want.

Virtual Servers. Virtual machines. Virtualization. Design of IBM s VM. Virtual machine systems can give everyone the OS (and hardware) that they want. Virtual machines Virtual machine systems can give everyone the OS (and hardware) that they want. IBM s VM provided an exact copy of the hardware to the user. Virtual Servers Virtual machines are very widespread.

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

Understanding the Linux 2.6.8.1 CPU Scheduler

Understanding the Linux 2.6.8.1 CPU Scheduler Understanding the Linux 2.6.8.1 CPU Scheduler By Josh Aas c 2005 Silicon Graphics, Inc. (SGI) 17th February 2005 Contents 1 Introduction 3 1.1 Paper Overview............................................

More information

White Paper. Real-time Capabilities for Linux SGI REACT Real-Time for Linux

White Paper. Real-time Capabilities for Linux SGI REACT Real-Time for Linux White Paper Real-time Capabilities for Linux SGI REACT Real-Time for Linux Abstract This white paper describes the real-time capabilities provided by SGI REACT Real-Time for Linux. software. REACT enables

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

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

ò 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

Kernel Optimizations for KVM. Rik van Riel Senior Software Engineer, Red Hat June 25 2010

Kernel Optimizations for KVM. Rik van Riel Senior Software Engineer, Red Hat June 25 2010 Kernel Optimizations for KVM Rik van Riel Senior Software Engineer, Red Hat June 25 2010 Kernel Optimizations for KVM What is virtualization performance? Benefits of developing both guest and host KVM

More information

Utilization Driven Power-Aware Parallel Job Scheduling

Utilization Driven Power-Aware Parallel Job Scheduling Utilization Driven Power-Aware Parallel Job Scheduling Maja Etinski Julita Corbalan Jesus Labarta Mateo Valero {maja.etinski,julita.corbalan,jesus.labarta,mateo.valero}@bsc.es Motivation Performance increase

More information

an embedded perspective on linux power management

an embedded perspective on linux power management an embedded perspective on linux power management discussions on pm technology by a guy who works for an embedded Linux OS vendor Todd Poynor MontaVista Software embedded pm today increasing hardware pm

More information