Course contentsShow
← Computer Science
Lesson 1430 of 2,87232. File SystemsFree lesson

I/O Schedulers in Operating Systems

Real-world implementations: deadline, CFQ, and NOOP schedulers in Linux and their design tradeoffs.

I/O Schedulers in Operating Systems

What you'll learn: How modern Linux kernels implement different I/O schedulers—deadline, CFQ, and NOOP—to balance fairness, latency, and throughput for diverse workload needs.

From Disk Scheduling Algorithms to I/O Schedulers

You've studied theoretical disk scheduling algorithms (FCFS, SSTF, SCAN). Real operating systems implement I/O schedulers that translate those ideas into production code with practical tradeoffs.

Three Major Linux I/O Schedulers

Deadline Scheduler

Enforces latency guarantees. Each request gets a deadline (default: 500ms reads, 5s writes). Serves requests in sorted order until a deadline is about to expire, then prioritizes that urgent request.

Tradeoff: Prevents starvation and meets real-time constraints, but may sacrifice peak throughput.

Completely Fair Queuing (CFQ)

Assigns each process its own queue and rotates fairly between them (like CPU scheduling). Within each queue, requests are sorted by disk location.

Tradeoff: Excellent fairness—no process starves others—but context-switching between queues adds overhead and may reduce raw throughput.

NOOP (No Operation)

A minimal scheduler that just maintains a simple FIFO queue with basic merging of adjacent requests. Assumes the hardware (like SSDs or RAID controllers) does its own smart scheduling.

Tradeoff: Lowest CPU overhead, ideal for random-access devices where seek time doesn't matter, but terrible for rotational disks.

Choosing the Right Scheduler

Modern systems often auto-select:

  • SSDs: NOOP or simpler schedulers (no seek penalty)
  • HDDs with mixed workload: CFQ (fairness matters)
  • Real-time or database servers: Deadline (latency bounds critical)

Key Takeaway: Linux I/O schedulers balance fairness, latency guarantees, and throughput by implementing different queueing and sorting policies—Deadline enforces time limits, CFQ ensures per-process fairness, and NOOP minimizes overhead for intelligent hardware.