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



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

Operating Systems. III. Scheduling.

Operating Systems Concepts: Chapter 7: Scheduling Strategies

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

W4118 Operating Systems. Instructor: Junfeng Yang

Linux Process Scheduling Policy

OPERATING SYSTEMS SCHEDULING

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

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

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

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

CPU Scheduling Outline

Operating Systems Lecture #6: Process Management

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

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

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

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

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

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

CPU Scheduling. CPU Scheduling

ICS Principles of Operating Systems

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

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

Operating System: Scheduling

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

Operating Systems, 6 th ed. Test Bank Chapter 7

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

Introduction. Scheduling. Types of scheduling. The basics

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

Scheduling Algorithms

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

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

Chapter 5 Process Scheduling

W4118 Operating Systems. Instructor: Junfeng Yang

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

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

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

Job Scheduling Model

Processor Scheduling. Queues Recall OS maintains various queues

PROCESS SCHEDULING ALGORITHMS: A REVIEW

CPU Scheduling. Core Definitions

OS OBJECTIVE QUESTIONS

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

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

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

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

Real-Time Scheduling 1 / 39

Overview of the Linux Scheduler Framework

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

Process Scheduling II

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

Threads Scheduling on Linux Operating Systems

Exercises : Real-time Scheduling analysis

REDUCING TIME: SCHEDULING JOB. Nisha Yadav, Nikita Chhillar, Neha jaiswal

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

Completely Fair Scheduler and its tuning 1

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

A Comparative Study of CPU Scheduling Algorithms

Syllabus MCA-404 Operating System - II

Process Scheduling in Linux

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

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

Lecture 3 Theoretical Foundations of RTOS

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

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

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

Analysis of Job Scheduling Algorithms in Cloud Computing

Linux Block I/O Scheduling. Aaron Carroll December 22, 2007

Operating System Tutorial

Process Scheduling in Linux

Analysis and Comparison of CPU Scheduling Algorithms

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

Comparison between scheduling algorithms in RTLinux and VxWorks

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

REAL TIME OPERATING SYSTEMS. Lesson-10:

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

This tutorial will take you through step by step approach while learning Operating System concepts.

Load Balancing in Distributed System. Prof. Ananthanarayana V.S. Dept. Of Information Technology N.I.T.K., Surathkal

Tasks Schedule Analysis in RTAI/Linux-GPL

Linux Scheduler. Linux Scheduler

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

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

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

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

A Review on Load Balancing In Cloud Computing 1

Mitigating Starvation of Linux CPU-bound Processes in the Presence of Network I/O

Improvement of Scheduling Granularity for Deadline Scheduler

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

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

Operating Systems 4 th Class

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Efficiency of Batch Operating Systems

Linux process scheduling

Chapter 11 I/O Management and Disk Scheduling

Operating Systems. Lecture 03. February 11, 2013

Final Report. Cluster Scheduling. Submitted by: Priti Lohani

Transcription:

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 the system load swap out a process? swap in a process? Low level scheduling Deciding which process should get CPU time next.

Scheduling 1 : Objectives System throughput should be maximised. Graceful degradation of performance. No sudden collapse! Provide a tolerable response time. Consistent behaviour, wrt job priority and from day to day.

Scheduling 2 : Criteria Job Priority : Depends on Category of job: batch, on-line, real-time. CPU bound or I/O bound. Resource requirements Waiting time to date. Resources used to date.

Scheduling 3 : Low-level Low-level scheduling can be: Preemptive Current process may be interrupted by o/s. new process arrived interrupt placed blocked process in Ready queue clock interrupt (time up). Non-Preemptive Process executes until it terminates blocks on I/O or system call. Cooperative As non-preemptive except that process may give up cpu voluntarily.

Scheduling 4 : Low-level Policies i First-come-first-served, or FIFO. Non-preemptive. first process to arrive in queue gets CPU when this process stops running, next in queue gets CPU ie. the process that has been waiting longest goes next. favours cpu-bound processes. Round Robin Uses a time-slice and preemption. each process runs for a short period when timer expires, or process blocks, next process runs design issue is length of time-slice. favours cpu-bound processes

Scheduling 5 : Low-level Policies ii Shortest job first. non-preemptive process with shortest expected processing time goes first. need to calculate processing time for each job. risk of starvation for long jobs Shortest remaining time preemptive version of SJF process with shortest remaining processing time runs. preempted if new shorter job arrives in queue. risk of starvation again. need to know process run time.

Scheduling 6 : Low-level iii. Highest Response Ratio Next non-preemptive. process with the highest ratio of waiting time : run time goes next. Favours shorter jobs. Doesn t starve longer jobs Still need to know how long the job will take to complete. Priority = waiting time + runtime runtime

Scheduling 7 : Low-level iv.i Multi-level feedback queues preemptive Run Queue 0 CPU Run Queue 1 Run Queue 2 after Operating Systems, 5th Ed. Stallings, Prentice Hall

Scheduling 8 : Low-level iv.ii Long processes can get starved, therefore : time quantum = τ Process first placed on RQ0 gets time slice of length τ x 2 0 If process does not complete then move to RQ1 gets time slice of length τ x 2 1 If process does not complete then move to RQ2 gets time slice of length τ x 2 In general a process on RQ i gets time slice of length τ x 2 i

Scheduling 9 : Generic Unix Traditional time-sharing, multi-user, interactive system. Uses multi-level feedback with round-robin queues. Preemption after 1 sec. Priority is recalculated every second using Where CPU j (i) = CPU j(i 1) 2 CPU j (i) P j (i) = Base j + CPU j(i) P j (i) + nice 2 Base j j from Operating Systems, W. Stallings 5th Ed. Pearson. nice j utilization by j in time i priority of j at start of i base priority of process j user adjustment for j Process with the lowest value has the highest priority

Scheduling 9.1 : generic Unix Queues are, in order of priority Swapper Block I/O device control File Manipulation Character I/O Device control User Process

Scheduling 10 : Linux pre 2.6 Linux has one run queue, but uses several scheduling policies, a number of priority levels and a niceness factor to control scheduling: Niceness is in the range -20 to +19, (user processes only) The priority is recorded in the priority field of the task_struct and is in the range 0-99 The policy is recorded in the policy field of the task_struct Policies are SCHED_RR SCHED_FIFO SCHED_OTHER

Scheduling 10.1 : Linux pre 2.6 SCHED_RR process base priority fixed for life in the range 1.. 99 Round-Robin scheduling runs until it blocks itself -> moved to wait Q preempted by higher priority process -> run Q uses up its quantum -> moved to run Q SCHED_FIFO process base priority fixed for life in the range 1.. 99 First come first served scheduling runs until it blocks itself -> moved to wait Q preempted by higher priority process -> run Q it completes current task -> moved to run Q

Scheduling 10.2 : Linux pre 2.6 SCHED_OTHER Used for all normal processes. Process base priority fixed at 0 Process has niceness factor which affects quantum. The counter field in task_struct is the quantum for a process. Decremented every clock tick when process running. Scheduler called when value = 0. counter field value recalculated as follows counter = Scale_Factor (20 (nice) + 1) The Scale_Factor is based on the processor speed and is to ensure that the standard quantum is around 50ms.

Scheduling 10.3 : Linux pre 2.6 Remember, all runnable processes are held in the same queue! The scheduler decides which process to run next by calculating the goodness factor. For policies SCHED_RR SCHED_FIFO goodness = 1000 + priority which puts real-time processes way above ordinary processes

Scheduling 10.4 : Linux pre 2.6 SCHED_OTHER is a bit more complex goodness = p->counter; if (p->processor == this_cpu) goodness += PROC_CHANGE_PENALTY; if (p->mm == this_mm!p->mm) goodness += 1; goodness += 20 - p->nice; goto out; If the counter value is zero for all processes then it is recalculated as p->counter = (p->counter >> 1) + NICE_TO_TICKS(p->nice);