Skip to contentSkip to conversation

CFQ will be the new default IO scheduler - why?

DISCUSSION Al Boldi 3 participants 5 messages Jul 24, 2006 – Jul 25, 2006 VFS

lore
Share & tools
lore

Al Boldi

author
#0 lore raw
Quoted 7 lines · Justin Piszcz
Quoted 6 lines · Matthias Andree
Quoted 4 lines · Paa Paa

The default IO scheduler in 2.6.18 will be CFQ (Complete Fair Queuing) instead of AS (Anticipatory Scheduler) as described here:
http://wiki.kernelnewbies.org/Linux_2_6_18. I tried to find (here, at lkml) the discussion about this change with no luck.

Quoted 8 lines
Quoted 5 lines

That wiki document nicely shows the advantage of the scheduler, namely that you have "ionice", which isn't possible for AS or Deadline Schedulers - this allows the operating system to run processes like updatedb with "nice I/O", meaning these hold when you're doing other I/O.

Should there be a default scheduler per filesystem? As some filesystems may perform better/worse with one over another?

It's currently perDevice, and should probably be extended to perMount.

Thanks!

--
Al

#1 lore raw
Quoted 5 lines
Quoted 3 lines

Should there be a default scheduler per filesystem? As some filesystems may perform better/worse with one over another?

It's currently perDevice, and should probably be extended to perMount.

Hi,

per mount is going to be "not funny". I assume the situation you are aiming for is the "3 partitions on a disk, each wants its own elevator". The way the kernel currently works is that IO requests the filesystem does are first flattened into an IO for the entire device (eg the partition mapping is done) and THEN the IO scheduler gets involved to schedule the IO on a per disk basis.
The 2.4 kernel did this the other way around, and it was really a bad idea (no fairness, less optimal scheduling all around due to less visibility into what the disk is really doing, several hardware properties such as TCQ depth that affect scheduling IOs are truely per disk not per partition etc etc)

So I don't think it's likely that per mount is really an option right now..

Greetings,
Arjan van de Ven

--
if you want to mail me at work, send mail to arjan (at) linux.intel.com

author
#2 lore raw
Quoted 6 lines · Arjan van de Ven
Quoted 4 lines
Quoted 2 lines

Should there be a default scheduler per filesystem? As some filesystems may perform better/worse with one over another?

It's currently perDevice, and should probably be extended to perMount.

Hi,

Hi!

Quoted 6 lines

per mount is going to be "not funny". I assume the situation you are aiming for is the "3 partitions on a disk, each wants its own elevator". The way the kernel currently works is that IO requests the filesystem does are first flattened into an IO for the entire device (eg the partition mapping is done) and THEN the IO scheduler gets involved to schedule the IO on a per disk basis.

IC. That probably explains why concurrent io-procs have such a hard time getting through to the disk. They probably just hang in the flatting phase, waiting for something to take care of their requests.

Quoted 8 lines

The 2.4 kernel did this the other way around, and it was really a bad idea (no fairness, less optimal scheduling all around due to less visibility into what the disk is really doing, several hardware properties such as TCQ depth that affect scheduling IOs are truely per disk not per partition etc etc)

So I don't think it's likely that per mount is really an option right now..

Probably true as it stands right now, but extending io-sched semantics to be filesystem aware in the "flattening/partition mapping" phase could improve performance a lot.

Thanks!

--
Al

#3 lore raw
Quoted 8 lines · Al Boldi
Quoted 4 lines · Arjan van de Ven
Quoted 3 lines
Quoted 2 lines

Should there be a default scheduler per filesystem? As some filesystems may perform better/worse with one over another?

It's currently perDevice, and should probably be extended to perMount.

Hi,

Hi!

Quoted 9 lines
Quoted 6 lines

per mount is going to be "not funny". I assume the situation you are aiming for is the "3 partitions on a disk, each wants its own elevator". The way the kernel currently works is that IO requests the filesystem does are first flattened into an IO for the entire device (eg the partition mapping is done) and THEN the IO scheduler gets involved to schedule the IO on a per disk basis.

IC. That probably explains why concurrent io-procs have such a hard time getting through to the disk. They probably just hang in the flatting phase, waiting for something to take care of their requests.

flattening is just an addition in the cpu, that's just really boring and shouldn't be visible anywhere performance wise

author
#4 lore raw
Quoted 18 lines · Arjan van de Ven
Quoted 17 lines · Al Boldi
Quoted 6 lines · Arjan van de Ven
Quoted 4 lines
Quoted 2 lines

Should there be a default scheduler per filesystem? As some filesystems may perform better/worse with one over another?

It's currently perDevice, and should probably be extended to perMount.

Hi,

Hi!

Quoted 6 lines

per mount is going to be "not funny". I assume the situation you are aiming for is the "3 partitions on a disk, each wants its own elevator". The way the kernel currently works is that IO requests the filesystem does are first flattened into an IO for the entire device (eg the partition mapping is done) and THEN the IO scheduler gets involved to schedule the IO on a per disk basis.

Quoted 6 lines
Quoted 3 lines

IC. That probably explains why concurrent io-procs have such a hard time getting through to the disk. They probably just hang in the flatting phase, waiting for something to take care of their requests.

flattening is just an addition in the cpu, that's just really boring and shouldn't be visible anywhere performance wise

Try this on 2.6 and 2.4 respectively:

# cat /dev/hda > /dev/null
< switch to another vt >
< login >
< start timing >
< wait for shell >
< stop timing >
< wait for dcache to be gobbled by cat and repeat login as necessary >

On my system 2.4.31 (2sec) is at least twice as fast as 2.6.17 (4-10sec) depending on io-scheduler, with noop/deadline performing best, albeit a lot of noise (scrubbing the disk), and anti/cfq performing worst, albeit quieter (just hanging around).

Thanks!

--
Al