practical factors non-preemptable portions (*) self-suspension of jobs (*) context switches (*)...
DESCRIPTION
Definition:[blocking time] The blocking time b i of Task T i is the longest time by which any job of T i can be blocked by lower-priority jobs: Time-demand function with blocking: Utilization bounds with blocking: test one task at a time: Analysis with Non-Preemptable Portions k nki i b 1 max k i k k iii e p t betw 1 1 )( )( iU p b p e p be p e p e RM i i i k k k i ii TRANSCRIPT
Practical Factors
• Non-Preemptable Portions (*)
• Self-Suspension of Jobs (*)
• Context Switches (*)
• Insufficient Priority Resolutions (Limited Number of Distinct Priorities)
• Time-Driven Implementation of Scheduler (Tick Scheduling)
• Varying Priorities in Fixed-Priority Systems
• Jobs, or portions thereof, may be non-preemptable.
• Definition: [non-preemptable portion]i : largest non-preemptable portion of jobs in Ti.
• Definition: [blocked job]A job is said to be blocked if it is prevented from executing by lower-priority job. (priority-inversion)
• When testing schedulability of a task Ti, we must consider – higher-priority tasksand– non-preemptable portions of lower-priority tasks
Practical Factors I: Non-Preemptability
• Definition: [blocking time]The blocking time bi of Task Ti is the longest time by
which any job of Ti can be blocked by lower-priority jobs:
• Time-demand function with blocking:
• Utilization bounds with blocking:test one task at a time:
Analysis with Non-Preemptable Portions
knkiib
1
max
k
i
k kiii e
ptbetw
1
1)(
)(...12
2
1
1 iUpb
pe
pbe
pe
pe
RMi
ii
k k
k
i
ii
Non-Preemptability: Example
w(t)
t2 4 6 8 10
w1(t)
w2(t)
w3(t)
time-
dem
and
func
tion
with
out b
lock
ing
w(t)
t2 4 6
time-
dem
and
func
tion
with
blo
ckin
g( T
3 non
-pre
empt
able
)
)2,9()5.1,5()1,4(
3
2
1
TTT
• Definition: [Self-Suspension]Self-suspension of a job occurs when the job waits for an
external operation to complete (RPC, I/O operation).
• Assumption: We know the maximum length of external operation; i.e., the duration of self-suspension is bounded.
• Example:
• Analysis: biSS : Blocking time of Ti due to self-suspension.
Practical Factors II: Self-Suspension
T2 = (2=3,p2=7,e2=2.0)
T1 = (1=0,p1=4,e1=2.5)
self-suspension!
) of timesuspension-self max. min of timesuspension-self max.
1
1 k
i-
k k
iSSi
T,(eTb
Self-Suspension with Non-Preemptable Portions
• Whenever job self-suspends, it loses the processor.• When tries to re-acquire processor, it may be blocked by tasks in non-
preemptable portions.
• Analysis: bNPi: Blocking time due to non-preemptable portions
Ki: Max. number of self-suspensionsbi: Total blocking time
bi = bSSi + (Ki + 1) bNP
i
• Definition: [Self-Suspension]Self-suspension of a job occurs when the job waits for an
external operation to complete (RPC, I/O operation).
• Assumption: We know the maximum length of external operation; i.e., the duration of self-suspension is bounded.
• Example:
• Analysis: biSS : Blocking time of Ti due to self-suspension.
Practical Factors II: Self-Suspension
T2 = (2=3,p2=7,e2=2.0)
T1 = (1=0,p1=4,e1=2.5)
self-suspension!
) of timesuspension-self max. min of timesuspension-self max.
1
1 k
i-
k k
iSSi
T,(eTb
Self-Suspension with Non-Preemptable Portions
• Whenever job self-suspends, it loses the processor.• When tries to re-acquire processor, it may be blocked by tasks in non-
preemptable portions.
• Analysis: bNPi: Blocking time due to non-preemptable portions
Ki: Max. number of self-suspensionsbi: Total blocking time
bi = bSSi + (Ki + 1) bNP
i
• Definition: [Job-level fixed priority assignment]In a job-level fixed priority assigment, each job is given a fixed priority for its entire execution.
• Case I: No self-suspension– In a job-level fixed-priority system, each job preempts at most one other
job.– Each job therefore causes at most two context switches– Therefore: Add the context switch time twice to the execution time of
job: ei = ei + 2 CS• Case II: Self-suspensions can occur
– Each job suffers two more context switches each time it self-suspends– Therefore: Add more context switch times appropriately:
ei = ei + 2 (Ki + 1) CS
Practical Factors III: Context Switches
• Definition: [Job-level fixed priority assignment]In a job-level fixed priority assigment, each job is given a fixed priority for its entire execution.
• Case I: No self-suspension– In a job-level fixed-priority system, each job preempts at most one other
job.– Each job therefore causes at most two context switches– Therefore: Add the context switch time twice to the execution time of
job: ei = ei + 2 CS• Case II: Self-suspensions can occur
– Each job suffers two more context switches each time it self-suspends– Therefore: Add more context switch times appropriately:
ei = ei + 2 (Ki + 1) CS
Practical Factors III: Context Switches
Practical Factors
• Non-Preemptable Portions (*)
• Self-Suspension of Jobs (*)
• Context Switches (*)
• Insufficient Priority Resolutions (Limited Number of Distinct Priorities)
• Time-Driven Implementation of Scheduler (Tick Scheduling)
• Varying Priorities in Fixed-Priority Systems