Skip to main content

Book Exercise Lanes

This module's exercise system is book-driven plus hands-on. Use these local chunks and hands-on tasks for targeted volume after you have already learned the concept from the guide.

How To Use This Page

  1. Finish the relevant concept page first.
  2. Do at least one paper trace from memory.
  3. Only then open the matching exercise lane.
  4. Keep a mistake log with tags such as confused fd with inode, wrong crash ordering, skipped directory fsync, dirty page not flushed, select used where epoll belongs, edge-triggered drain loop missing, or assumed close implies fsync.

Lane 1: The File Abstraction (inodes, directories, FDs)

Use this lane when the issue is the three-layer kernel table model or directory semantics.

Target outcomes:

  • 8 stat/ls -li traces (inode number, link count changes) performed on real files
  • 4 fork + shared-FD drills with predicted and observed behavior
  • 2 directory-lookup traces from mount point to target inode

Lane 2: On-Disk Layout and Archetypes

Use this lane when you cannot draw the on-disk structure or trace a read to an LBA.

Target outcomes:

  • 6 hand-drawn ext-style layouts with addresses and sizes
  • 4 read traces from inode + offset to LBA
  • 2 comparisons of ext vs LFS on the same workload (append-heavy, random-update-heavy)

Lane 3: Crash Consistency

Use this lane when you cannot reason about post-crash state for multi-step operations.

Target outcomes:

  • 6 operations (append, overwrite, rename, unlink, mkdir, hard-link) with crash-state tables for naive, journaled, and COW
  • 4 written "worst case" crash narratives with recovery steps
  • 2 correct implementations of "durable atomic file replacement" pattern

Lane 4: I/O Models and Performance

Use this lane when you cannot pick between blocking, epoll, and io_uring, or cannot measure I/O performance.

Target outcomes:

  • a single-threaded epoll echo server handling 1k+ connections
  • a measurement report of fsync cost across at least 4 modes
  • a short comparison of select, epoll, and io_uring from your own run, with CPU and throughput numbers
  • 2 written debugging narratives from strace, iostat, or blktrace on your own workload

Self-Curated Problem Set

Build a custom set with these minimums:

  • 5 crash-consistency scenarios across naive / journaled / COW
  • 5 layout tracing exercises (inode + offset -> LBA)
  • 5 fork / dup / open behavior predictions, verified in code
  • 5 I/O performance measurement tasks (cache-hot, cache-cold, sequential, random, fsync on/off)
  • 3 server builds (thread-per-conn, epoll, io_uring) and a comparison

Completion Checklist

  • Completed at least one lane in full
  • Built the FUSE FS kata
  • Built the epoll echo server kata
  • Produced the fsync-cost table kata
  • Produced the crash-recovery simulator kata
  • Logged at least 10 real mistakes and corrections
  • Read strace, iostat, or blktrace output on your own workload at least twice