You are not logged in.
Pages: 1
Since I'm too noobish to understand the code for the various kernel schedulers... How does the I/O scheduler CFQ work?
If I had to guess, I would say it might:
- Somehow merge I/O requests to consecutive/arbitrarily nearby sectors
- Divide available I/O bandwidth by the number of requests
- Assign each request a random position in line, and service the lower numbers first
- Switch to the next request and assign the prior one a new random number once the bandwidth limit has been used up (assuming the old request isn't finished)
I'm betting it's much more complicated than that though, else CFQ would actually be fair. So... how does it really work? And how do schedulers like Con Kolivas' BFS improve on it (assuming they work as intended)?
Offline
I don't know specifics, but I'll point out the following:
- CFQ detects the media type (rotating vs non-rotating .. think SSD) and tunes its rules accordingly.
- It's definitely a fair queue mechanism (that's what the F in CFQ is for). It uses timeslicing which is affected by cgroups and a process's I/O priority.
- BFS is a CPU scheduler, not an I/O scheduler. If you use a kernel patched with BFS, you can use both BFS and CFQ at the same time.
Offline
Ah, I'd thought BFS was an I/O scheduler. Thanks.
Re fairness, in practice I've noticed that all of the Linux schedulers will more or less give priority to I/O hogs; the best way around this seems to be to forcibly limit write bandwidth using vm.dirty_bytes, which is a terrible hack. So I guess fairness != preventing hoggery?
Offline
Perhaps http://algo.ing.unimo.it/people/paolo/disk_sched/ would be of interest to you. There's quite a bit of I/O scheduler info there.
Offline
Pages: 1