The program scheduler
The scheduling strategies of the kernel, measured side by side (docs/SCHEDULING.md).
The program runs four cases under each strategy: two threads that wake each other while spinners keep each processor busy; a thread that sleeps 2 ms, many times, while 8 spinners run, with the delay of each wake; 8 spinners of one weight, their shares and their work; 12 spinners with the weights 1, 2 and 4, their shares. Then it changes the strategy 100 times while threads start, stop, wake each other and move. The window shows the numbers and the strategy in use; the keys 1, 2 and 3, or a click on a strategy, change it.
The program checks what does not depend on the load of the host: no spinner starved, EEVDF woke more often than round robin in the same run, the weights order the shares under the strategies with weights, each thread runs after the changes, no wake was lost, the kernel refuses a change with no right Schedule and a weight above the full weight.
The program needs the machine with the rights Inspect and Schedule.
| Fact | Value |
|---|---|
| Source | programs/scheduler |
| Boot image | in the boot image; the image is not built, so its size is not known |
| Imports | none |
| Imported by | none |
Exports
| Export | What it does |
|---|---|
| entry() |
Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | {.Inspect, .Schedule} | It reads the counts of the scheduler, and changes the strategy. |
| Budget: pages, programs, threads | {pages = 2048, programs = 1, threads = 24} | 12 spinners, two threads that wake each other, one that sleeps, a changer, a thread that starts threads. |
Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.
