33 - Scheduling: SRPT and Fairness  pp. 518-530

Scheduling: SRPT and Fairness

By Mor Harchol-Balter

Image View Previous Chapter Previous Chapter



In this chapter, we introduce Shortest-Remaining-Processing-Time (SRPT) scheduling. SRPT is even superior to the PSJF policy that we saw in the last chapter, because it takes a job's remaining service requirement into account, not just the original job size. We also compare all the scheduling policies that we have studied so far with respect to mean response time as a function of load and the variability of the job size distribution. Finally, we study the fairness of SRPT by comparing it to the (fair) PS policy and proving the All-Can-Win theorem.

Shortest-Remaining-Processing-Time (SRPT)

Under SRPT, at all times the server is working on that job with the shortest remaining processing time. The SRPT policy is preemptive so that a new arrival will preempt the current job serving if the new arrival has a shorter remaining processing time.

Observe that, under SRPT, once a job, j, starts running, it can only be preempted by a new arrival whose size is shorter than j's remaining time. In particular, any jobs that are in the system with j, while j is running, will never run before j completes.

Remember that in Exercise 2.3 we proved that SRPT achieves the lowest possible mean response time on every arrival sequence. In this section, we analyze the mean response time for SRPT in the M/G/1 setting.

Question: Can we look at SRPT as some type of preemptive priority system with classes?

Answer: No! The problem is that in SRPT a job's priority is its “remaining” size, which changes as the job ages. The preemptive priority model does not allow jobs to change priorities while in queue.