Scheduling Preemptive Policies

Slides:



Advertisements
Similar presentations
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
Advertisements

Scheduling in Batch Systems
Carnegie Mellon University Computer Science Department 1 CLASSIFYING SCHEDULING POLICIES WITH RESPECT TO HIGHER MOMENTS OF CONDITIONAL RESPONSE TIME Adam.
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
Chapter 6 CPU SCHEDULING.
Chapter 7 Scheduling Chien-Chung Shen CIS, UD
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Scanf n, a, b /* I-O wait */ for (i=1; i
Analysis of SRPT Scheduling: Investigating Unfairness Nikhil Bansal (Joint work with Mor Harchol-Balter)
Process CPUArrival Time P P2 3 0 P3 3 0 The Gantt Chart for the schedule is: Waiting time for P1 = (7-7)=0; P2 = (0-0)=0; P3 = (3-0)
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Chapter 7 Scheduling Chien-Chung Shen CIS/UD
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
UNIT–II: Process Management
CPU SCHEDULING.
Chapter 6: CPU Scheduling
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Chapter 5a: CPU Scheduling
Serve Assignment Policies
Networks and Operating Systems: Exercise Session 2
M/G/1 Busy Period & Power Optimization
Uniprocessor Scheduling
Uniprocessor Scheduling
Scheduling Preemptive Policies
Scheduling Non-Preemptive Policies
Process Scheduling B.Ramamurthy 9/16/2018.
Scheduling (Priority Based)
CPU Scheduling.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Batch Scheduling Algorithms
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Andy Wang Operating Systems COP 4610 / CGS 5765
Operating Systems Lecture 15.
Operating System Concepts
So far…. Firmware identifies hardware devices present
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Outline Scheduling algorithms Multi-processor scheduling
Exercise Ms.Reema alOraini
CGS 3763 Operating Systems Concepts Spring 2013
Chapter 5: CPU Scheduling
Lecture 2 Part 3 CPU Scheduling
Process Scheduling B.Ramamurthy 2/23/2019.
Processor Scheduling Hank Levy 1.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
CPU SCHEDULING CPU SCHEDULING.
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
CPU Scheduling: Basic Concepts
Chapter 6: CPU Scheduling
Mean Delay Analysis of Multi Level Processor Sharing Disciplines
Uniprocessor Scheduling
Prof. Deptii Chaudhari.
Uniprocessor Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Presentation transcript:

Scheduling Preemptive Policies Sized Based

Preemptive Size-Based Policies Jobs in service can be interrupted, and job “priority” is a function of its size Jobs resume service where they had stopped Sample policies Preemptive-SJF (PSJF), Shortest-Remaining-Processing-Time (SRPT)

PSJF Policy Analysis At any point in time, the job in service, if any, is the one with the shortest (original) job size Analyzing PJSF Limit analysis of preemptive priority policy Number of priority classes goes to infinity Transform analysis

PSJF Policy Analysis – (1) Recall response time of kth priority class in preemptive priority policy Assume that jobs of size x are in their own priority class, we then have where is load of jobs of size ≤ x First term is busy period of jobs of size < x that interrupt service of job of size x Second term is waiting time before job of size x gets in service

PSJF Transform Analysis – (1) Notation T = Response time Tx = Response time of job of size x T(s) = ∫xTx(s)fS(x)dx – transform of response time Tx(s) = Waitx(s)Resx(s) – (Tx = Waitx + Resx) Waitx = waiting time of job of size x Resx = residence time of job of size x λx = λF(x) – arrival rate of jobs of size ≤ x Sx = size (arbitrary) of job of size ≤ x ρx = λxE[Sx] = λ ∫{t=0 to x}t fS(t)dt – load from jobs of size ≤ x Wx = work in system from jobs of size ≤ x Bx = duration of busy period from jobs of size ≤ x – (they don’t see bigger jobs) Note that Bx(s) = Sx(s+λx–Bx(s)) – from derivation of busy period of M/G/1 Ayx = number of arrivals of size ≤ x during time y Our goal is to derive an expression for Tx(s) – from which T(s) can be derived

PSJF Transform Analysis – (2) We will derive expression for Waitx(s) and Resx(s) Resx = x + Σ{i=1 to Axx} Bx(i) Bx(i) is ith busy period from jobs of size ≤ x Resx(s) = e–sxAxx(Bx(s)) = e–sxe–(λx)x(1–Bx(s)) = e–x(s+λx–λxBx(s)) Waitx(s) = Wx(s+λx–λxBx(s)) – busy period started by Wx Wx = work in PSJF (and FCFS) from jobs of size ≤ x = queueing time in FCFS with only jobs of size ≤ x Recall TQ(s)FCFS = s(1 – ρ)/[λS(s)–λ+s] Wx(s) = s(1 – ρx)/[λxSx(s)–λx+s] and Waitx(s) = (s+λx–λxBx(s))(1 – ρx)/[λxSx(s+λx–λxBx(s))–λx+(s+λx–λxBx(s))] This then implies

Shortest Remaining Processing Time SRPT is known to be optimal under any arrival sequence Jobs in service are preempted only by arrivals that have a shorter service time than their residual service time The main challenge of SRPT is that jobs priorities are dynamic, i.e., change as job is in service As with PSJF, we can write E[Tx] = E[Waitx] + E[Resx]

SRPT Analysis Outline – (1) E[Resx] = ∫{t=0 to x}dt/(1–ρt) A job’s priority increases as it ages once it has started service Once its remaining service reaches t, the job is affected only by the load from jobs of size < t The time for a job’s remaining service time going from t+dt to t is a busy period started by dt work with only jobs of size < t The expected length of such a busy period is dt/(1–ρt) As the job’s residual service time decreases, so does the length of the corresponding busy period Job’s residence time = sum/integral of those busy periods

SRPT Analysis Outline – (2) First term is identical to mean waiting time in PSJF Duration of busy period started by Wx, work in the system from jobs of size < x, with only arrivals of size < x In SRPT, work starting busy period includes an additional term: λx2(1–F(x))/2 Contributions from jobs of size > x [occur with probability(1–F(x))], which each contribute x2 (those jobs contribute only if their residual service time reaches x) Numerator is also similar to that of the waiting time in FB, i.e., λ/2E[Sx̄2], where jobs of size > x are transformed into jobs of size x However, in SRPT the denominator involves ρx (as opposed to ρ̵x) because only jobs of size < x are allowed to enter the busy period

Evaluating SRPT Response time is affected only by Variance of job size distribution up to x Load from jobs of size up to x Once its service, only jobs that are smaller than its remaining service time Waiting time is longer than with PSJF, but residence time is shorter, and the latter dominates when weighed over jobs of all sizes SRPT outperforms FB for all x and loads

Comparing Scheduling Policies SRPT offers the best overall response time across all scheduling policies SRPT is mostly insensitive to job size variability SRPT is also best for all jobs when ρ < ½ for any job size distribution (and for much higher ρ values for many distributions)