Lecture Notes for Operating Systems
Process scheduling, 15 September 1999
These are provisional lecture notes, expect changes.
- scheduling - what is it
- which process gets to execute next
- scheduling objectives - fairness, utilization (total) vs. efficiency
(useful), response time, turnaround, throughput
- pre-emptive vs. non-pre-emptive scheduling
- job characteristics are unpredictable - lots of guessing, adjusting,
and modeling.
- user defined scheduling objectives
- scheduling overhead - picking and switching
- shortest job first
- minimize the average completion time
- batch-oriented, interactive jobs require estimation - arithmetic
vs. geometric averages
- round robin
- a quantum (or a time slice) - how long a process runs before being
stopped by the scheduler
- processes are queued; the head runs; stopped processes are re-queued
- setting the quantum appropriately relative to scheduler overhead
- priority
- all processes are not created equally - some should be run before
others.
- priority captures the notion of relative importance among processes
- static vs. dynamic and user vs system priority assignments
- dynamic system adjustments recover from bad guesses and other events -
premature context switching
- multiple queues
- an alternative - have varying quantum
- high priority short quantum (interactive) low priority long quantum
(compute intensive)
- scheduling complexity quickly grows - unintended consequences,
increasing overhead
- guaranteed scheduling
- contract to provide a certain level of service
- quality of service (QoS)
- lottery scheduling
- probabilistic scheduling - select process i with probability
pi
- for the lottery, pi is p's tickets over total tickets
- flexible, instantaneous
- economic scheduling - auctioning and bidding
- real-time scheduling
- model
- process have finite, known duration
- events trigger processes - periodic or aperiodic
- deadlines on process termination
- reaction times, bounded response
- hard and soft real-time systems
- fixed process set
- periodic utilization - execution/period; schedulable
- dynamic vs. static scheduling
- rate monotonic scheduling - priority proportional to occurrence
frequency: e.g. every 20 msec -> 50 times a sec -> priority 50
- deadline, periodic and aperiodic; earliest deadline first scheduling
- laxity, from now to the latest possible starting time; least laxity
scheduling
- special operating systems - stripped down, high performance, timer
rich.
- two-level scheduling
- not all runnable processes fit in main store - disk swap space
- now two types of movement are needed - main store-cpu and disk-main
store
- the scheduler needs to handle both kinds of movement, or you need two
schedulers
- criteria - residency, last cpu access, process size, priority
- policy vs. mechanism
- policy - what you want to happen
- mechanism - how you can cause something to happen
- example - policy: run as many jobs as possible (high throughput);
mechanisms: shortest jobs first, kill long jobs.
- one of the principle mistakes in system design (of any kind) is to
specify mechanism instead of policy.
- examples
- nt
- four priority classes - real time, high, normal, idle; real time is
static, others dynamic
- seven priority levels - time critical, highest, above normal
normal, below normal, lowest, idle
- classes and levels combine to provide over-all priority
- solaris
- scheduling classes - time sharing, real time, and system
- real time - high priority, pre-empts os, other features
- dynamically loaded modules - parameter tables and actual functions
- ia class - overcomes ts-rr performance problems; violates layering
This page last modified on 20 September 1999.