Bug 66

Summary: I/O schedule isn't no-op on flash based devices
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Ross Burton - Disabled <ross>
Component: meta-yoctoAssignee: Darren Hart <dvhart>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: Low CC: bruce.ashfield, jessica.zhang, poky.bs.watcher, poky.watcher, richard.purdie, sgw
Version: 0.9   
Target Milestone: 1.1   
Hardware: All   
OS: Multiple   
Whiteboard: Suggest close as WILL_NOT_FIX (16/Mar/2011)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Ross Burton - Disabled 2008-07-23 17:02:46 UTC
The I/O scheduler defaults to anticapatory, which means a small inefficiency on devices with a flash based file system.  This should change to no-op.
Comment 1 Richard Purdie 2011-02-22 09:49:46 UTC
We should aim to be able to set the default io scheduler for devices like this even if the zaurus is still no longer in tree
Comment 2 Darren Hart 2011-02-22 15:29:21 UTC
This seems reasonable and I'll start looking into it. As I lack the history here, why the comment about "even if the zaurus is ... no longer in tree"?
Comment 3 Darren Hart 2011-02-22 17:00:42 UTC
I see that on the beagleboard (which is known to boot from a microSD card) we only have the noop scheduler available:

# cat /sys/block/md0/queue/scheduler                          
none

When the image we prepare can be written to any number of devices (spinning disk, usb key, DOM, SSD, etc) it could be that one scheduler performs better than another depending on the media. Flash media doesn't suffer from seek latencies, but there appears to be concern that reads can be starved with the noop scheduler and that the deadline scheduler is a better choice. From what I can gather, workload will also impact which IO scheduler will perform best.

As such, I'm not inclined to try and make a minor performance enhancement which seems to be just as likely to backfire under certain workloads. I believe the right thing to do is to enable noop,CFQ, and deadline as part of the base linux-yocto branch and allow users to customize their own images with the "elevator=noop|cfq|deadline" kernel cmdline.

Bruce, any thoughts on that?
Comment 4 Darren Hart 2011-02-22 17:02:57 UTC
I'd like to hear back from Bruce and possibly Ross if he's still interested before taking any action.
Comment 5 Bruce Ashfield 2011-02-22 19:03:12 UTC
At least the for the 2.6.37 kernel, this is already the situation. Looking
at my qemux86 and beagleboard 2.6.37 based kernels, I have:

CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"

In the .configs, so all of the options should be available. 

A quick check on my atom-pc-stable build also shows the same settings,
which is what I'd expect.

The thinking is the same as the conclusion that Darren came to, this is
a BSP (or more precisely a deployment specific) option, so choosing any
one option in particular is a matter left up to the final customization of
the BSP. 

Even if we automatically detected the image type, there still remains
the possibility that the BSP developer would want to override a setting, which
would mean a series of detected defaults, with a place for final override, etc. 

So the design decision is to keep them all available and either let the default
be chosen by Kconfig in the BSP, or on the bootline.
Comment 6 Darren Hart 2011-03-16 15:44:35 UTC
No response from the original submitter or others. I suggest we close as will not fix as Bruce and I are in agreement here. We can open another bug should something similar come up in the future for which our responses here are not adequate.
Comment 7 Richard Purdie 2011-11-15 07:33:23 UTC
I think old imported bugs somehow don't email the original reporters any more. 

There is a general configuration issue still standing here - how would I specify in a machine configuration file that for my root and home partitions I would like the NOOP scheduler?
Comment 8 Ross Burton - Disabled 2011-11-15 07:52:50 UTC
I actually thought that this was mostly solved now, the kernel exposes a "rotational" property on block devices.  I assumed that this was used to change the default scheduler, but maybe you don't ever want noop because it doesn't do *anything* like collapsing identical reads. Who knows, certainly not me!

Anyway, the point was that the "rotational" block property should be useful for this, if this is something you actually want to do.
Comment 9 Richard Purdie 2011-11-15 07:58:32 UTC
Whilst it might expose a rotatable parameter does anything act upon that? Certainly userspace doesn't, not sure about the kernel schedulers internally. Identical reads should hit the disk cache fwiw.
Comment 10 Darren Hart 2012-01-17 09:02:53 UTC
In the machine config, specify the following to set your preferred elevator:

APPEND += "elevator=(cfq|deadline|noop)"
Comment 11 Darren Hart 2012-04-06 22:14:13 UTC
No activity in over a year. Assuming the provided mechanism is adequate. Closing.