Linux process scheduling



Similar documents
Overview of the Linux Scheduler Framework

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

AT&T Global Network Client for Windows Product Support Matrix January 29, 2015

Analysis One Code Desc. Transaction Amount. Fiscal Period

COMPARISON OF FIXED & VARIABLE RATES (25 YEARS) CHARTERED BANK ADMINISTERED INTEREST RATES - PRIME BUSINESS*

COMPARISON OF FIXED & VARIABLE RATES (25 YEARS) CHARTERED BANK ADMINISTERED INTEREST RATES - PRIME BUSINESS*

Case 2:08-cv ABC-E Document 1-4 Filed 04/15/2008 Page 1 of 138. Exhibit 8

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

CPU Scheduling Outline

Process Scheduling II

Konzepte von Betriebssystem-Komponenten. Linux Scheduler. Valderine Kom Kenmegne Proseminar KVBK Linux Scheduler Valderine Kom

Process Scheduling in Linux

Enhanced Vessel Traffic Management System Booking Slots Available and Vessels Booked per Day From 12-JAN-2016 To 30-JUN-2017

Threads Scheduling on Linux Operating Systems

Linux Process Scheduling Policy

W4118 Operating Systems. Instructor: Junfeng Yang

Comparing share-price performance of a stock

Linux O(1) CPU Scheduler. Amit Gud amit (dot) gud (at) veritas (dot) com

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

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

Ashley Institute of Training Schedule of VET Tuition Fees 2015

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

CENTERPOINT ENERGY TEXARKANA SERVICE AREA GAS SUPPLY RATE (GSR) JULY Small Commercial Service (SCS-1) GSR

PROJECTS SCHEDULING AND COST CONTROLS

Proposal to Reduce Opening Hours at the Revenues & Benefits Coventry Call Centre

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

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

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

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

BCOE Payroll Calendar. Monday Tuesday Wednesday Thursday Friday Jun Jul Full Force Calc

Computing & Telecommunications Services Monthly Report March 2015

Chapter 5 Process Scheduling

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

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

Linux Scheduler. Linux Scheduler

Time Management II. June 5, Copyright 2008, Jason Paul Kazarian. All rights reserved.

CAFIS REPORT

Detailed guidance for employers

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

Completely Fair Scheduler and its tuning 1

Accident & Emergency Department Clinical Quality Indicators

Interest Rates. Countrywide Building Society. Savings Growth Data Sheet. Gross (% per annum)

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

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

Tasks Schedule Analysis in RTAI/Linux-GPL

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

A Resource for Free-standing Mathematics Units. Data Sheet 1

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

Insurance and Banking Subcommittee

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

Independent Accountants Report on Applying Agreed-Upon Procedures

Choosing a Cell Phone Plan-Verizon

Process Scheduling in Linux

14-Dec-15. Number Amount Number Amount Number Amount Number Amount Number Amount

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

Consumer ID Theft Total Costs

P/T 2B: 2 nd Half of Term (8 weeks) Start: 25-AUG-2014 End: 19-OCT-2014 Start: 20-OCT-2014 End: 14-DEC-2014

P/T 2B: 2 nd Half of Term (8 weeks) Start: 26-AUG-2013 End: 20-OCT-2013 Start: 21-OCT-2013 End: 15-DEC-2013

Operating Systems Concepts: Chapter 7: Scheduling Strategies

P/T 2B: 2 nd Half of Term (8 weeks) Start: 24-AUG-2015 End: 18-OCT-2015 Start: 19-OCT-2015 End: 13-DEC-2015

Department of Public Welfare (DPW)

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

oct 03 / 2013 nov 12 / oct 05 / oct 07 / oct 21 / oct 24 / nov 07 / 2013 nov 14 / 2013.

LeSueur, Jeff. Marketing Automation: Practical Steps to More Effective Direct Marketing. Copyright 2007, SAS Institute Inc., Cary, North Carolina,

Procurement Planning

2016 Examina on dates

2015 Examination dates

SEO Presentation. Asenyo Inc.

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

Real-Time Scheduling 1 / 39

OPERATIONS SERVICE UPDATE

A!Team!Cymru!EIS!Report:!Growing!Exploitation!of!Small! OfCice!Routers!Creating!Serious!Risks!

PowerSteering Product Roadmap Your Success Is Our Bottom Line

Resource Management Spreadsheet Capabilities. Stuart Dixon Resource Manager

Human Resources Management System Pay Entry Calendar

Climatography of the United States No

Metric of the Month: The Service Desk Balanced Scorecard

Climatography of the United States No

a. mean b. interquartile range c. range d. median

Academic Calendar Arkansas State University - Jonesboro

Centers of Academic Excellence in Cyber Security (CAE-C) Knowledge Units Review

Grid Operations and Planning

Hedging Milk with BFP Futures and Options

Supervisor Instructions for Approving Web Time Entry

OPERATING SYSTEMS SCHEDULING

Financial Operating Procedure: Budget Monitoring

Marsha Ingram, Head of Corporate Affairs

NASDAQ DUBAI TRADING AND SETTLEMENT CALENDAR On US Federal Reserve Holidays, no settlements will take place for USD.

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

opennms reporting generation tool

An Introduction to the. Society Program Portfolio Management Process

Employers Compliance with the Health Insurance Act Annual Report 2015

Trimble Navigation Limited (NasdaqGS:TRMB) > Public Ownership > Officials' Trading

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

Project Cost & Schedule Monitoring Process Using MS Excel & MS Project

Manchester City Council Report for Information. Managing Attendance (Real Time Absence Reporting)

CASE STUDY: SIMULATION OF THE CALL CENTER ENVIRONMENT FOR COMPARING COMPETING CALL ROUTING TECHNOLOGIES FOR BUSINESS CASE ROI PROJECTION

Transcription:

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 attention most of the time, don t need it demand it occasionally, need it immediately then batch don t care about responsiveness demand attention frequently, don t need it immediately

General strategies favor all realtime processes ahead of all other processes favor interactive processes ahead of batch processes by explicitly identifying and applying different formulas, or (pre-kernel-.6.) by applying a common formula (wait-time based) tending to float interactives and sinks batches (current kernel.6.+) General scheduling basics multiple processes chosen to run for brief intervals one-after-the-other choice based on process merit or deservedness different possible merit characteristics time a process has spent waiting (patience) relative importance of a process (priority) linux considers several characteristics in combination always chooses the most deserving process

Patience may be meritorious runqueue (double-linked list of process descriptors) cpu decreasing wait time task picked to run Priority may also be meritorious task picked to run (most patient among top priority) cpu A B C increasing priority decreasing wait time

Five scheduling classes FOR REALTIME PROCESSES SCHED_FIFO SCHED_RR (first-in first-out) (round robin) FOR REGULAR PROCESSES SCHED_NORMAL SCHED_BATCH SCHED_IDLE a.k.a SCHED_OTHER Different schedulers The realtime scheduler SCHED_FIFO SCHED_RR (first-in first-out) (round robin) The completely fair scheduler (CFS) SCHED_NORMAL SCHED_BATCH SCHED_IDLE

Priority scale REGULAR 0 REALTIME increasing priority 99 Realtime requirements low latency deterministic response time settings financial trading medical devices defense industrial automation

Realtime trumps regular 99 98 increasing priority REALTIME 0 REGULAR Former priority scale* 0 REALTIME REGULAR 99 00 9-0 +9 increasing priority *reflected in literature

Former priority implementation task picked to run (first in not-yet-served line) cpu active not yet served expired already served Each process is given a fixed time quantum, after which it is preempted and moved to the expired array. Once all the tasks from the active array have exhausted their time quantum and have been moved to the expired array, while the expired array becomes the active array. Input to scheduling decisions SCHED_SETSCHEDULER() Linux Programmer's Manual SCHED_SETSCHEDULER() NAME sched_setscheduler SYNOPSIS policy here int sched_setscheduler( pid_t pid, int policy, const struct sched_param *param ); struct sched_param {... int sched_priority;... }; DESCRIPTION Scheduling Policies The scheduler is the kernel component that decides which runnable process will be executed by the CPU next. Each process has an associated scheduling policy and a static scheduling priority, sched_priority; these are the settings that are modified by sched_setscheduler(). The scheduler makes it decisions based on knowledge of the scheduling policy and static priority of all processes on the system. (see sched_setscheduler.man.abridged.txt) priority here

Input to scheduling decisions DESCRIPTION Currently, Linux supports the following "normal" (i.e., non-real-time) scheduling policies: SCHED_OTHER the standard round-robin time-sharing policy; SCHED_BATCH for "batch" style execution of processes; and SCHED_IDLE for running very low priority background jobs. The following "real-time" policies are also supported, for special time-critical applications that need precise control over the way in which runnable processes are selected for execution: SCHED_FIFO a first-in, first-out policy; and SCHED_RR a round-robin policy. Scheduling Policies SCHED_FIFO: First In-First Out scheduling SCHED_FIFO can only be used with static priorities higher than 0, which means that when a SCHED_FIFO processes becomes runnable, it will always immediately preempt any currently running SCHED_OTHER, SCHED_BATCH, or SCHED_IDLE process. SCHED_OTHER: Default Linux time-sharing scheduling SCHED_OTHER can only be used at static priority 0. SCHED_OTHER is the standard Linux time-sharing scheduler that is intended for all processes that do not require the special real-time mechanisms. Scheduling class implementation Resembles object-oriented class hierarchy Correct handler selected per scheduling class of each particular process Extensible, for implementing future scheduling classes with new scheduling algorithms for SCHED_OTHER SCHED_BATCH SCHED_IDLE (the normal classes) for SCHED_FIFO SCHED_RR (the realtime classes) Completely Fair Scheduler, Linux Journal, August 009

Two demo programs (heavy loops) non-realtime realtime DESCRIPTION Currently, Linux supports the following "normal" (i.e., non-real-time) scheduling policies: SCHED_OTHER the standard round-robin time-sharing policy; SCHED_BATCH for "batch" style execution of processes; and SCHED_IDLE for running very low priority background jobs. The following "real-time" policies are also supported, for special time-critical applications that need precise control over the way in which runnable processes are selected for execution: SCHED_FIFO a first-in, first-out policy; and SCHED_RR a round-robin policy. Scheduling Policies SCHED_FIFO: First In-First Out scheduling SCHED_FIFO can only be used with static priorities higher than 0, which means that when a SCHED_FIFO processe becomes runnable, it will always immediately preempt any currently running SCHED_OTHER, SCHED_BATCH, or SCHED_IDLE process. SCHED_OTHER: Default Linux time-sharing scheduling SCHED_OTHER can only be used at static priority 0. SCHED_OTHER is the standard Linux time-sharing scheduler that is intended for all processes that do not require the special real-time mechanisms. Binary trees elements have up to child elements left child sorts less, right more, than parent tree has a depth tree has a balance, comparing depths of its left and right trees (greater difference, less balance)

Binary tree of months, for days-per-month determination jan feb 8 mar apr 0 jun 0 may aug jul sep 0 dec oct Depth: 4 Max comparisons: 6 Average comparisons:.5 nov 0 input sequence: jan, feb, mar, apr, may, june, july, aug, sept, oct, nov, dec (chronological) A skewed tree apr 0 aug dec feb 8 jan jul jun 0 mar may nov 0 Depth: Max comparisons: Average comparisons: 6.5 search cost O(N) elements comparisons N elements N comparisons oct sep 0 input sequence: apr, aug, dec, feb, jan, july, june, mar, may, nov, oct, sept (alphabetical)

A balanced tree jul feb may aug jan mar oct apr dec jun nov sep Depth: 4 Max comparisons: 4 Average comparisons:. search cost O(log N) levels elements comparisons levels 7 elements comparisons 4 levels 5 elements 4 comparisons L levels L - elements L comparisons, or log(n+) levels N elements log(n+) comparisons input sequence: july, feb, may, aug, dec, mar, oct, apr, jan, june, sept, nov Binary tree of last names, for data record determination jacobs 7 brown 6 jones anders 5 miller smith 4 Database Recno name rank serial no miller corporal 4-9 jones major -09 baker private 7-98 4 smith lieutenant -0 5 anders private 8-88 6 brown sargeant 8-7 jacobs captain 6-495 8 johnson general 4-556

Binary tree of number metrics, for process determination 07 cal 0 grep 0 ps 9 tr 0 less 5 ksh 80 rm 7 cp 96 sort 6 mv 5 vi 5 cat Numbers developed to reflect variance between ideal and actual CPU utilization for each process Smallest number greatest variance (most underserved ) Smallest gets CPU. While it runs its metric rises while the others all fall till one of them undercuts, then it becomes the new running process Tree balance depends on insertion sequence balance achievable independent of sequence, by performing mid-course re-balancing during insertion, whenever an insertion upsets the balance, re-balance dynamically before inserting next element tree never gets unbalanced, so final result is always balanced

Building tree, no rebalancing insert insert insert insert 4 insert 5 4 4 5 input sequence:,,, 4, 5 final tree unbalanced Building tree, mid-course re-balancing insert insert insert insert 4 insert 5 4 4 re-balance re-balance 5 4 5 input sequence:,,, 4, 5 final tree balanced

More information scheduler author Ingo Molnar http://people.redhat.com/mingo/cfs-scheduler/scheddesign-cfs.txt Multiprocessing with the Completely Fair Scheduler http://www.ibm.com/developerworks/linux/library/lcfs/index.html