Borrowed Virtual Time Scheduler
Idea
Equalize virtual CPU time consumed by different processes
- Run process with the lowest effective virtual time
- Effective virtual time = A_i - (warp_i ? W_i : 0)
- A_i = actual virtual time consumed by process i
- Warp factor allows borrowing against future CPU time
Process weights
Each process i’s share of actual processor time is determined by its weight
- Process i should get
fraction of the actual processor time - When i consumes t processor time, track it as
Problem
Lots of context switches
- Not good for performance
Idea
Add in context switch allowance, C,
- So each process runs for a bit of time,
before preemption - Only switch from i to j if
Sleep / wakeup
Must lower priority after wakeup
- Otherwise process with very low
will starve the other processes
Have a lower bound on with a minimum time, Scheduler Virtual Time
- SVT is minimum virtual time
- When waking i from voluntary sleep
- Don’t set for involuntary
Real-time threads
Goal: Support soft real-time threads
- Threads that need to run within a certain time or performance will degrade
is warp factor - gives a thread precedence
- It will get the CPU whenever it is runnable
- Long term CPU share won’t exceed
only matters when is true - Need two other parameters
and - Can get
set with a system call or signal handler - Gets cleared if i keeps using CPU for
time limit gets reset every time
- Gets cleared if i keeps using CPU for