What is the difference between CFQ, Deadline, and NOOP?

37,553

Solution 1

If you compile them all, you can select at boot time or per-device which scheduler to use. No need to pick at compile time, unless you are targeting an embedded device where every byte counts. See Documentation/block/switching-sched.txt for details on switching per-device or system-wide at boot.

The CFQ scheduler allows you to set priorities via the ionice(1) tool or the ioprio_set(2) system call. This allows giving precedence to some processes or forcing others to do their IO only when the system's block devices are relatively idle. The queues are implemented by segregating the IO requests from processes into queues, and handling the requests from each queue similar to CPU scheduling. Details on configuring it can be found in Documentation/block/cfq-iosched.txt.

The deadline scheduler by contrast looks at all writes from all processes at once; it sorts the writes by sector number, and writes them all in linear fashion. The deadlines means that it tries to write each block before its deadline expires, but within those deadlines, is free to re-arrange blocks as it sees fit. Details on configuring it can be found in Documentation/block/deadline-iosched.txt.

Solution 2

Probably very little in practice.

In my testing, I found that in general NOOP is a bit better if you have a clever RAID controller. Others have reported similar results, but your workload may be different.

However, you can select them at runtime (without reboot) so don't worry about it at compile-time.

My understanding was that the "clever" schedulers (CFQ and deadline) are only really helpful on traditional "spinning disc" devices which don't have a RAID controller.

Share:
37,553
Orcris
Author by

Orcris

Updated on February 18, 2020

Comments

  • Orcris
    Orcris about 4 years

    I'm recompiling my kernel, and I want to choose an I/O scheduler. What's the difference between these?

  • r004
    r004 almost 10 years
    No-op also works well with SSD