What is the difference between CFQ, Deadline, and NOOP? [closed]
Asked Answered
P

2

9

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

Protein answered 18/2, 2012 at 3:54 Comment(0)
R
14

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.

Reorganization answered 18/2, 2012 at 4:11 Comment(0)
I
4

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.

Ingmar answered 18/2, 2012 at 7:22 Comment(1)
No-op also works well with SSDRadarscope

© 2022 - 2024 — McMap. All rights reserved.