Lecture 11 - More on Scheduling
Last time we talked a bit about scheduling algorithms. We keep the discussion going.
Examples of Preemptive Scheduling
Priority Scheduling: Give each job a priority (rank, price, etc.) and choose the most important one. The idea is to break the priorities into classes:
- IO Bound first (they block)
- Then compute bound (they don't block, faster to compute)
For example, there's CTSS: Compatible Time Sharing System:
- Uses a large quantum for CPU-bound jobs
- Process that use the whole quantum move down
- Process doing IO move up to the top again
But you can grant priority based on:
- Process already in memory? Give higher priority.
- Locks held/needed
- Resource requirements
- Shortest remaining work yet
Another example would be lottery, where you just say "LOL completely random" and be random with the processes.
Minix Scheduling
Minix uses the following structure:
- Layer 1: Written in Assembly. The other layers are in C.
- Layer 2: IO Processes, one per device type. Compiled w/ the kernel
- Layer 3: Server process: File System, Memory Manager, etc. They never terminate while the system is running
- Layer 4: User level
Minix 2 uses the following scheduling schema per level:
Minix 3 added a 16-level priority scheduling system:
- Variable quantum size set in the process table
- A process that uses the entire quantum will be given another one and sent to the end of the queue
- Potential change of priority level for processes using complete quanta
- If it uses its whole quantum and is its own successor: drops a level
- If not, rises a level
- Process that block with time remaining in their quantum are moved to the head of the queue when they return, but only with the remaining part of their quanta
Three-Level Scheduling
For any scheduling scheme we schedule at three different locations/types:
- admission: The system can decide whether or not to admit
- memory: Constraints are different for jobs in memory and on disk
- disk: (above)