CPU Scheduling
Explain and measure how the scheduler shares CPUs among tasks, and tune priorities, affinity and CPU limits on Linux.
3 objectives 6 steps about 120 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Compute turnaround and response time for FIFO, SJF, round-robin and MLFQ on a given workload and explain the trade-offs.
- Explain how Linux's fair scheduler (EEVDF) uses weights and virtual time, and how real-time and deadline policies differ.
- Adjust and verify scheduling with nice, chrt, taskset and cgroup cpu.weight or cpu.max, and read load average, run-queue and context-switch metrics correctly.
Lesson plan
6 steps, about 120 min · 0 of 5 lessons available so far
- Scheduling goals and metrics: throughput, turnaround, response and fairness Concept · 15 min · coming later
- Worked example: one workload under FIFO, SJF, round-robin and MLFQ Worked example · 25 min · coming later
- Inside Linux scheduling: weights, virtual runtime, EEVDF and real-time classes Concept · 20 min · coming later
- Lab: competing CPU hogs under nice, chrt, taskset and cgroup limits Lab · 30 min · coming later
- Reading load average, run queue and context-switch counters correctly Concept · 15 min · coming later
- Check: predict scheduler behaviour and justify a tuning choice Knowledge check · 6 questions
Practise it
Write a scheduler simulator (C or Python) for FIFO, SJF, round-robin and MLFQ that prints per-job turnaround and response time for a given trace, then run two busy loops pinned to one CPU with different nice values and explain the measured CPU shares using the weight table.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Operating SystemAdvanced · 40–80 h
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.