Lottery and Stride Scheduling: Flexible Proportional-Share Resource Management (1994)

Schedulers multiplex scarce resources and can greatly impact the throughput and response times of a system. Ideally, schedulers service clients with relative computation rates. Existing priority schedulers do this to some degree but are ad-hoc. Similarly, fair-share and microeconomic schedulers are too coarse. This paper introduces lottery scheduling which implements proportional-share resource management: consumption rates are proportional to relative shares allocated.

Lottery Scheduling. Lottery schedulers allocate resource rights to clients in the form of tickets. Lotteries are held, and the client with the winning ticket is granted the resource.

Tickets are

Lottery scheduling is a probabilistic scheduling algorithm, but when quanta are small, fairness can be achieved rapidly. Moreover, there is no fear of starvation. As long as a client has tickets, it will eventually be scheduled.

Modular Resource Management. - Ticket transfers. Clients can transfer tickets to others. For example, a client blocking on a server can transfer tickets to the server. This effectively avoids priority inversion. - Ticket inflation. Mutually trusting applications can inflate or deflate tickets in order to change resource allocation without communication. - Currencies. Logically distinct groups of mutually trusting applications can establish their own currencies backed by the same base currency. This allows for finer grained ticket allocation. - Compensation tickets. If a client runs for only f of its quanta, its number of tickets is boosted by 1/f to ensure fairness.

Implementation. The authors implemented a lottery scheduling prototype in the Mach 3.0 microkernel with all of the features listed above and with a 100 ms quantum.

Managing Diverse Resources. Lottery scheduling can be used to manage more than CPU quanta.