A proportional share scheduler (比例份额调度) is also called “fair-share scheduler(公平份额调度)”. Each job obtains a certain amount of time; not optimized for turnaround or response time.

Mechanism: “tickets” - means the share of resource a process should receive. CPU time is distributed according to ticket percentage.

Lottery scheduling

Lottery scheduling(彩票调度): the possibility of get CPU (or, win the lottery) is relevant with the percentage of tickets.

Tickets currency(彩票货币): the number of tickets the user gives is not limited, and the OS converts it into “global currency”, which has a certain amount of total share. (e.g. 500 User A’s currency → 50 global currency)

赢麻了,2000RMB>3000USD

Ticket transfer(彩票转让): a process can temporarily hand off tickets to other processes.

Ticket inflation(彩票通胀): if a process needs more CPU time, it can boost its tickets.

Unfairness metric: $U=\frac{t_1}{t_2}$ t1=the time process 1 completes; t2 the same. The closer it is to 1, the fairer it is. If job is short, it can be really unfair.

Stride scheduling(步长调度)

Stride: how long a process advances every time it’s called. Ticket number * stride = a certain number. (BIG_STRIDE in uCore)

Pass: how long a process has gone since the beginning.

Every time, the scheduler picks a process with the least pass, and add its stride to its pass, marking it has gone further. After some time, the pass of each process is equal.

However, one may find it hard to deal with a newly-added process.