Book Exercise Lanes
This module's exercise system is book-driven and measurement-driven. Use these local chunks for targeted volume after you have already learned the concept from the guide; complement them with real machine measurements.
How To Use This Page
- Finish the relevant concept page first.
- Solve one problem or draw one Gantt chart of your own from memory.
- Only then open the matching exercise lane.
- Keep a mistake log with tags such as
wrong metric,bad Gantt,confused response vs turnaround,forgot arrival time,wrong MLFQ rule,off-by-one quantum,missed priority inversion,wrong cgroup knob, oraffinity surprise.
Lane 1: Process Model and Lifecycle
Use this lane when you are comfortable with definitions but not yet with fork/exec/state-transition reasoning.
- OSTEP 4.3: Process Creation detail
- OSTEP 4.4: Process States
- OSTEP 4.5: Data Structures (PCB)
- OSTEP 5.1: fork()
- OSTEP 5.3: exec()
- OSTEP 5.4: Why? Motivating the API
- OSTEP 5.5: Other Parts of the API
- OSTEP: Homework Code
- OS Concepts: 3.3.1 Process Creation Part 1
- OS Concepts: 3.3.1 Process Creation Part 2
- OS Concepts: 3.3.2 Process Termination
- OS Concepts: Chapter 3 Exercises
- OS Concepts: Programming Problems Part 1
Target outcomes:
- 5
fork/exec/waitprograms traced by hand with correct output prediction - 3 state-transition diagrams drawn for realistic workloads (CPU-bound, IO-bound, oversubscribed)
- 1 small shell clone (
minish) that usesfork+execve+waitpid - 2
strace -fcaptures annotated line-by-line
Lane 2: Scheduling Policy and Metrics
Use this lane when you understand policies individually but are slow to compute metrics or compare.
- OSTEP 7.1: Workload Assumptions (FCFS/SJF/STCF)
- OSTEP 7.6: Response Time
- OSTEP 7.7: Round Robin
- OSTEP 8.1: MLFQ Basic Rules
- OSTEP 8.2: MLFQ Attempt #1
- OSTEP 8.5: Tuning MLFQ
- OSTEP 8.6: MLFQ Summary
- OSTEP 9.1: Tickets Represent Your Share
- OSTEP 9.2: Ticket Mechanisms
- OSTEP 9.5: Assigning Tickets
- OS Concepts: 5.2 Scheduling Criteria
- OS Concepts: 5.3.3 Round-Robin
- OS Concepts: 5.3.5 Multilevel Queue
- OS Concepts: 5.6.3 Rate-Monotonic
- OS Concepts: Chapter 5 Practice Exercises
- OS Concepts: 5.8.3 Simulations
Target outcomes:
- 10 Gantt charts drawn (mix of FCFS, SJF, SRTF, RR) with correct turnaround/waiting/response averages
- 4 MLFQ simulations for mixed (CPU-bound + interactive) workloads
- 2 RMS/EDF schedulability tests computed and argued
- 2 "when does RR degenerate to FCFS?" and "when does SJF starve?" scenarios constructed
- 1 proportional-share simulation (by hand or in Kata 4)
Lane 3: Context Switch and Threads vs Processes
Use this lane when you can draw the state diagram but cannot yet reason about switch cost or thread/process choice.
- OSTEP 6.1: Limited Direct Execution
- OSTEP 6.2: Restricted Operations
- OSTEP 6.3: Switching Part 1
- OSTEP 6.3: Switching Part 2
- OSTEP 6.3: Switching Part 3
- OSTEP 6.5: Summary (switch cost)
- OSTEP 19.5: TLB Context Switches
- OSTEP 26: Concurrency Intro
- OSTEP 26.1: Thread Creation
- OSTEP 26.2: Shared Data
- OS Concepts: Chapter 4 Threads
- OS Concepts: 4.5.2 Fork-Join
- OS Concepts: 4.7.2 Linux Threads
- OS Concepts: Chapter 4 Exercises
Target outcomes:
- 4 context-switch step-lists (different triggers) annotated with hardware vs kernel vs user-space steps
- 2 context-switch cost estimates computed symbolically and compared to a measured number from Kata 2
- 3 "threads or processes?" design decisions with two-sentence justifications
- 1 written comparison of same-core thread switch, cross-core thread switch, and process switch with predicted and measured numbers
Lane 4: Modern Systems - Multi-core, CFS, cgroups
Use this lane when the single-CPU mental model is solid and you want to move to the production reality.
- OSTEP 10.2: Don't Forget Synchronization
- OSTEP 10.4: Single-Queue
- OSTEP 10.5: Multi-Queue
- OSTEP 10.7: Multi-CPU Summary
- OSTEP 9.7: Proportional Share Summary
- OS Concepts: 5.5.1 Multi-Processor Approaches
- OS Concepts: 5.5.4 Processor Affinity
- OS Concepts: 5.7.1 Linux Scheduling Part 1
- OS Concepts: 5.7.1 Linux Scheduling Part 2
- OS Concepts: 5.7.2 Windows Scheduling
- OS Concepts: 5.7.3 Solaris Scheduling
Target outcomes:
- 3
mpstat/perf schedcaptures under different pinning schemes, with analysis - 2 CFS vruntime hand-simulations confirming the weight->share ratio
- 2 cgroup experiments (weight-only, weight+max) with
cpu.statoutput captured - 2 "why is my pod throttled?" diagnoses written as triage narratives
- 1 written comparison of Linux CFS, Windows priority-boost scheduler, and Solaris fair-share
Self-Curated Problem Set
Build a custom set with these minimums:
- 6 Gantt-chart problems across at least 4 policies
- 4
fork/execprograms with hand-traced output - 4 context-switch walks for different triggers
- 4 multi-core / affinity / cgroup experiments
- 2 real-time schedulability tests (one RMS, one EDF)
Completion Checklist
- Completed at least one full exercise lane
- Logged at least 12 real mistakes and corrections in your notebook
- Drew at least 15 Gantt charts from scratch with correct averages
- Measured context-switch cost on your own machine (Kata 2 complete)
- Ran at least one cgroup throttling experiment (Kata 7 complete)
- Wrote a triage explanation for at least 3 different scheduling/performance complaints
- Can explain the difference between
nice,sched_setscheduler, andcpu.weightin one paragraph without reference