Date post: | 02-Jan-2016 |
Category: |
Documents |
Upload: | reynold-mccormick |
View: | 218 times |
Download: | 1 times |
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 bound Lower bound
UW (resume)
No penalty
4 [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+)
13232 2
Previous and Our Results (PP)
Upper bound Lower 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]
2)1( k 2)1( k2)1( k
/11ln1
1/11
1/1
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
23232 2 5.15.2454 2
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 vi to vi+1,
UW Lower Bound (PP/IMM)
v0
v1
v2
i
j j
i
j jii vvvv0
1
01 )(
1
0
i
j ji vvONL
)(1
0
1
0
i
j ji
i
i j vvvOPT
Lemma: if < 4(1+), {vi} cannot be strictly increasing forever
Let vn be the last term. Then If ONL is about to finish vn, release another job of value
vn just before it finishes
Lower Bound (cont’d)
n
j j
n
j jnn vvvv0
1
0)(
1
0
n
j jn vvONL
)(1
00
n
j jn
n
i jn vvvvOPT vn-1
vn
vn
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• vk-1 ≤ vk / , vk-2 ≤ vk-1 / , …, v1 ≤ v2 /
• Value obtained = vk – (v1+…+vk-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
v1
vk
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 (v1…vk) map to it can show total of v(j) < vk (or v1 if k=1)
Each basic subschedule is mapped by:
OPT
ONL
v1+…+vk v1 vk
v1 vk
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 { ji } in the provisional schedule so that their preemption create a long enough timeslot to fit the new job, and that v(ji) < v(j) /
• If no such set exists, reject j• Else preempt those ji, 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.)
23232 2
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 j1,…,jm, then v(j)
< v(ji)
OPT
Aj1 j2
<(v(j1)+v(j2))
Suppose an R-job j starts at t when ONL is idle• St[t] is empty. By monotone property, Sr(j)[t] is also empty
• By no-gap property, Sr(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 Sr(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 ji’s
Bounding R jobs
t
j
j1 j2
<(v(j1)+v(j2))
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
5.15.2454 2
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
v1
< (v1+v2)
v2
v1 v2 v1v1
v1
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 1.618 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(St[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(St[u]) < w(j’)), the subsequently evicted j’’, …
-competitive
Lower bound?
Unit Jobs + IMM NOTIF
2222 2
Algorithm:• Keep a provisional schedule S• When a new job j arrives, find any slot u such that w(St[u]) <
w(j)/ for some • Replace St[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 / …