Fair Share Scheduling o Group processes into sets oThese sets could be formed

# Fair share scheduling o group processes into sets

• 104

This preview shows page 50 - 53 out of 104 pages.

Fair Share Scheduling: o Group processes into sets o These sets could be formed on a per user basis or on a user group basis, as well o Balancing the scheduling is performed with respect to these sets. o For instance, each user (or user group) is assigned a weighing of some sort that defines the fraction of resources that corresponding processes may use o The scheduling is done with priorities and the formulae for a process j in a group k would look like: CPUj(i) = CPUj(i-1)/2 GCPUj(i) = CPUj(i-1)/2 Pj(i) = BASEj + CPU(i-1)/2 + GCPUk(i-1)/(4*Wk) where CPUj(i) is a measure of CPU utilization by process j through interval i GCPUk(i) is a measure of processor utilization of group k through interval i Pj(i) is the priority of process j at the beginning of interval i (lower values mean higher priorities) BASEj is the base priority for process j Wk is the weighting assigned to group k , with 0 <= Wk <= 1 and the sum of Wk 's over k is equal to 1. As we can see, each process is assigned a base priority and the priority of a process is dynamically controlled by the above equations. 4. 4.3 BSD Unix Scheduling Here we proceed to describe an example of the scheduling policy implemented in 4.3 BSD: The quantum time is set to 1 second Priority is computed with respect to process type and execution history. The equations governing their behavior are : o CPUj(i) = CPUj(i-1)/2 Compiled by http: 50 o Pj(i) = BASEj + CPU(i-1)/2 + NICEj, where NICEj is a user supplied value. Each second, the priorities are recomputed by the scheduler and a new scheduling decision is made. CS305b OPERATING SYSTEMS 1. Multiprocessor Scheduling Usually, processes are not dedicated to processors in a multiprocessor machine. General solutions to the scheduling problem would not be available then. We have seen that on a single processor machine, sophisticated algorithms for scheduling may improve Compiled by http: 51 performance. However, with multiprocessor computers, these refinements may lead to unnecessary scheduling overhead. As a matter of fact, maximum utilization of each processor is less of an issue in multiprocessors, where we tend to favor increased speed of execution through parallelism. In addition, the use of threads is a common way to achieve this parallelism effectively. 2. Process Scheduling In a multiprocessor machine, the typical scheduling algorithms we find are rather simple. For instance, there can be a unique process queue, and each processor takes the first process from the queue and runs it. This is an attractive scheme, for it is simple. However, it is easy to imagine how to slow down such a system. Given short execution time processes and a constant flow of them arriving in the queue, then all processors will have to contend for gaining access to the process queue to pick up their next process to run.  • • • 