Department of Computer Science Stanley P. Y. Fung Online Preemptive Scheduling with Immediate Decision or Notification and Penalties.

Slides:



Advertisements
Similar presentations
Mehdi Kargahi School of ECE University of Tehran
Advertisements

Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Chapter 3: CPU Scheduling
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Scheduling in Batch Systems
1 Ecole Polytechnque, Nov 7, 2007 Scheduling Unit Jobs to Maximize Throughput Jobs:  all have processing time (length) = 1  release time r j  deadline.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-CPU Scheduling
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
7/12/2015Page 1 Process Scheduling B.Ramamurthy. 7/12/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
Chapter 6: CPU Scheduling
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Chapter 6 CPU SCHEDULING.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
Scheduling policies for real- time embedded systems.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Competitive Queue Policies for Differentiated Services Seminar in Packet Networks1 Competitive Queue Policies for Differentiated Services William.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Loss-Bounded Analysis for Differentiated Services. By Alexander Kesselman and Yishay Mansour Presented By Sharon Lubasz
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Non-Preemptive Buffer Management for Latency Sensitive Packets Moran Feldman Technion Seffi Naor Technion.
1 JOB SEQUENCING WITH DEADLINES The problem is stated as below. There are n jobs to be processed on a machine. Each job i has a deadline d i ≥ 0 and profit.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU Scheduling CSSE 332 Operating Systems
Chapter 5a: CPU Scheduling
Assignment Problem, Dynamic Programming
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Process Scheduling B.Ramamurthy 11/18/2018.
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
György Dósa – M. Grazia Speranza – Zsolt Tuza:
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Presentation transcript:

Department of Computer Science Stanley P. Y. Fung Online Preemptive Scheduling with Immediate Decision or Notification and Penalties

Motivation  Preemption is not really “free” E.g. context switch in CPU scheduling  Introduce preemption penalty (PP): each preemption introduces a penalty proportional to value of job  Related but different scenario: we want commitment to process a job If a job cannot be processed, better to let the client know early  Introduce non-completion penalty: if an accepted job is later not finished, gives a penalty

Immediate Decision/Notification  How to model “commitment”:  Immediate Notification (IMM NOTIF): Upon a job’s arrival, have to decide immediately whether to accept the job, or reject it right away If rejected, no value (customer goes away) If an accepted job is eventually not completed, incurs a penalty (cannot charge customer since work not done; in addition, customer is unhappy when he finds this out)  Immediate Decision (IMM DEC): A stronger notion where in addition, an accepted job needs to be immediately allocated a time window for execution (“your delivery will take place on Friday morning”)

Problem Formulation  Input: a set of jobs Parameters: release time r(j), deadline d(j), length p(j), weight w(j) Value of a job v(j) = p(j) x w(j) Unit length (UL) case: p(j) = 1 for all j Unit weight (UW) case: w(j) = 1 for all j  Objective: Find a schedule with maximum total value of completed jobs, minus any penalties  Penalty model: penalty =  × v(j)  Preemptive We mainly consider the restart model But also some on resume model (Doesn’t matter in IMM DEC)

Online Algorithms  Jobs arrive online No information about future Decisions irrevocable  Measure of performance: competitive ratio An online algorithm A is c-competitive if for any input instance I, OPT(I)/A(I) ≤ c Where OPT = offline optimal algorithm, A(I) = value of A on instance I

Previous and Our Results (PP) Upper boundLower bound UW (resume) No penalty4 [BKM+92]4 [Woeg 94, BKM+92] Penalty 4(1+  ) (resume and restart) 4(1+  ) UL (restart) No penalty 4.56 [ZFC+06], 4 for tight jobs 4 [Woeg 94] penalty [ZXDZ05] 4(1+  )

Previous and Our Results (PP) Upper boundLower bound Resume, k = max w / min w No penalty [KS95] [BKM+92] Penalty Restart,  = max p / min p No penalty O(  /log  ) [Ting08]  (  /log  ) [ZFC+06, Ting08] Penalty (1+  )  + o(  ) [ZXP09]

Previous and Our Results (IMM)  Previous results: IMM DEC + UW: an upper bound from [TL09] No other prior result for preemptive case Non-preemptive case considered in various papers (usually UL, and parallel machines)  Our results: IMM DEC (or IMM NOTIF + restart) UW: UL: Lower bound 4(1+  ) carries over to here Lower bound with laxity

 Tight jobs: PP = IMM NOTIF = IMM DEC  No algorithm gives competitive ratio better than 4(1+  )  Idea: (similar to [BKM+92, Woeg94]) If switch to short job, stop If not preempt from v i to v i+1, UW Lower Bound (PP/IMM) v0v0 v1v1 v2v2

 Lemma: if  < 4(1+  ), {v i } cannot be strictly increasing forever  Let v n be the last term. Then  If ONL is about to finish v n, release another job of value v n just before it finishes Lower Bound (cont’d) v n-1 vnvn vnvn

PP + UW: Algorithm  4(1+  )-competitive algorithm: Let  = 2(1+  )  2,  = 2(  – 1)   Job arrival: add to pool When idle, start the pending job with earliest expiry time While j is running, if another job k reaches its expiry time:  If v(k) >  v(j) and j has preempted other jobs before, or  If v(k) >  v(j) and j has not preempted others before  Then preempt j and start k; j never considered again  Else continue with j (and k will expire)

Ideas of Proof  Basic subschedules: sequence of preemption followed by one job completion v k-1 ≤ v k / , v k-2 ≤ v k-1 / , …, v 1 ≤ v 2 /  Value obtained = v k –  (v 1 +…+v k-1 )  Times in OPT when ONL is busy  OK (1 to 1)  Times in OPT when ONL is idle For each (part of) such job j executed by OPT, map it to some basic subschedule in ONL v1v1 vkvk

Ideas of Proof  When OPT starts (part of) a job j while ONL idle: If ONL is idle at x(j) (expiry time of j), only possible if j started/completed before its expiry  j is the first job in a basic subschedule  map to it Otherwise, x(j) falls within some basic subschedule (v 1 …v k )  map to it  can show total of v(j) <  v k (or  v 1 if k=1)  Each basic subschedule is mapped by: OPT ONL v 1 +…+v k v1v1 vkvk v1v1 vkvk

IMM DEC + UW: Algorithm  At any time, the algorithm maintains the provisional schedule of accepted jobs  Execute according to provisional schedule  When a new job j arrives: Identify a set of jobs { j i } in the provisional schedule so that their preemption create a long enough timeslot to fit the new job, and that  v(j i ) < v(j) /  If no such set exists, reject j Else preempt those j i, schedule j in the new empty interval (as early as possible)

Properties of Provisional Schedule  Theorem: -competitive  Simple but useful properties of provisional schedule: “No gap”, i.e. no idle period between planned jobs in it “monotone”, i.e. once a time t becomes busy, won’t become idle later on If a preemption happens, it preempts a suffix of the provisional schedule  Only linear number of potential job sets to consider (prov. sch.)

Ideas of Proof  Classify jobs in OPT into four sets: C: Completed in both OPT and ONL R: Rejected by ONL (upon arrival) D: Discarded by ONL (preempted before getting started) A: Aborted by ONL (preempted while execution)  Jobs in R: Cannot start in idle time in ONL If start in a busy period with completed jobs j 1,…,j m, then v(j) <   v(j i ) OPT A j1j1 j2j2 <  (v(j 1 )+v(j 2 ))

 Suppose an R-job j starts at t when ONL is idle S t [t] is empty. By monotone property, S r(j) [t] is also empty By no-gap property, S r(j) [u] is all empty for u > t Hence j could not be rejected  Suppose j starts at t when ONL is busy Rejected due to a set X of jobs in S r(j) [t] s.t. v(j) <  v(X) Jobs in X may be preempted but replaced by other (higher- value) jobs in the same busy period (no-gap) Eventually goes to one of j i ’s Bounding R jobs t j j1j1 j2j2 <  (v(j 1 )+v(j 2 ))

Ideas of Proof  Consider one busy period  Let V(C) = V  Jobs in D/A: Can prove v(D) + v(A)  V/(  – 1)  Jobs in R: v(R)  L +  V where L = length of b.p.  v(C) + v(A)  (1+1/(  – 1))V  OPT  v(C) + v(A) + v(D) + v(R)  ONL  v(C) –  (v(D)+v(A))  Competitive ratio = OPT/ONL, choose a optimised 

IMM DEC + UL  Same algorithm  Provisional schedule different properties: Each preemption preempts either one job, or two including the currently executing one Efficient identification of candidate preemption sets  Theorem: -competitive  Proof: Similar ideas for C, A, D Different bound for R

Proof for UL Case  Each job in R is “blocked” by at most 2 jobs in provisional schedule (i.e. jobs in C/A/D) Total value  (value of R-job)/  Distribute the values to them  Each job in C/A/D “blocks” at most two jobs in R (i.e. in OPT) V(R)  2  ( v(C)+v(A)+v(D) ) Prov.sch. OPT v1v1 <  (v 1 +v 2 ) v2v2 v1v1 v2v2 v1v1 v1v1 v1v1

 Discrete time steps, p(j) = 1 = time step size  No issue of preemption  Without immediate decision/notification: unit job scheduling problem Motivation: buffer management in QoS switches Previous results:  Deterministic UB 1.828, LB  Randomized UB 1.582, LB 1.25  Various restricted cases, adversary models etc Unit Jobs

 Algorithm: Keep a provisional schedule S When each job j arrives: Find the earliest slot u before d(j) in S such that w(S t [u]) < w(j)/  for some . Evict this job (call it j’) and j takes its place. If no such slot, reject j Repeat above for the evicted job j’ (but with different condition w(S t [u]) < w(j’)), the subsequently evicted j’’, …  -competitive  Lower bound? Unit Jobs + IMM NOTIF

 Algorithm: Keep a provisional schedule S When a new job j arrives, find any slot u such that w(S t [u]) < w(j)/  for some  Replace S t [u] with j  4(1+  )-competitive   (  ) lower bounds Unit Jobs + IMM DEC

Future Work  PP + UL: gap still exists E.g. between (4, 4.56) for restart without penalty  Better bounds for IMM DEC + UL (=UW?)  Upper/lower bounds to separate the competitive ratio of IMM DEC / IMM NOTIF / no-commitment Algorithms here works for IMM NOTIF, but trivially  Unit jobs lower bounds  IMM DEC but limited re-scheduling / wider interval / …