Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CS F372
CPU Scheduling
Biju K Raveendran
• Average sleep time is also used by the scheduler to
determine whether a given process should be
considered interactive or branch process
• Interactive process
– Dynamic priority <= 3 X static priority / 4 + 28
– Which is equivalent to Bonus – 5 >= static priority / 4 – 28
– static priority / 4 – 28 is called the interactive delta
• varies from -3 (highest priority) to +6 (lowest priority)
– It is far easier for a high priority process to become interactive
than low priority process
• Process with priority 100 is considered interactive if bonus >2
(when its average sleep time exceeds 200ms)
• Process with priority 139 is never considered interactive because
bonus value required is 11 which is not achievable
139 139
Monday, October 21, 2019 Biju K Raveendran @ BITS Pilani Goa 9
• recalc_task_prio()
– Updates the dynamic priority of a process
– Updates the average sleep time of a process
• schedule()
– Selects a process from the runqueue list and assign CPU to it.
– Invoked directly or lazy (deferred) way
• Direct
– The current process is blocked right away because the resource it
needs is not available.
• Lazy invocation
– By setting the TIF_NEED_RESCHED flag of current process to 1
– Check on the value of this flag is made before resuming the
execution of a User Mode Process