As you have probably read, I bought a new laptop with an SSD drive recently, a Lenovo x301. Today I opened my SSD to see what’s inside and it turns out Lenovo is using quality drives. They are manufactured by Samsung, which use a decent I/O controller and cache memory contrary to the cheap drives you can buy these days which use lousy JMicron JMF602 controllers (Like the OCZ Core series). I started to wonder if I could gain even more performance…
On a forum, a friend told me to also have a look at the I/O scheduler used by the Linux kernel, he heard that you could gain some performance out of SSD drives by playing with it. Not knowing what he was talking about, I began to do some research…The first thing I came across was a Red Hat article explaining what the 4 I/O schedulers available in modern (~ post 2.6.10) Linux kernels were.
There are basically 4 algorithms you can select to control the way your data is saved/read from your disks. The default one used in Fedora 10 is called “Completely Fair Queuing” and was primarely designed with standard mechanical disks in mind. When you move data around, it tries to determine an optimal access path to minimize your hard disk’s heads movements. With SSDs we don’t have this problem anymore because the access time is constant across all the drive, so the whole computing part which takes resources is superfluous.
To know which scheduler is currently active on your disk (let’s say sda), you can run the “cat /sys/block/sda/queue/scheduler” command. The one in brackets is what’s active.
noop anticipatory deadline [cfq]
With this setting, I started to run some benchmarks, basically a little shell script uncompressing and compiling a default 2.6.28.2 Linux kernel…nothing fancy. It outputs a total time in seconds.
#!/bin/bash
START=$(date +%s)
tar -jxf linux-2.6.28.2.tar.bz2
cd linux-2.6.28.2
make
STOP=$(date +%s)
TOTAL=$(($STOP – $START))
echo $TOTAL
With the CFQ scheduler, it took 4161 seconds to compile the kernel.
Then I switched to the “NOOP” scheduler, which is just a “stupid” but fast FIFO algorithm who relies on the physical disk’s controller to optimize the accesses. So there is no CPU calculation overhead here. To switch to this algorithm, simply append “elevator=noop” to the kernel line in your grub.conf.
With the NOOP scheduler, it took only 3653 seconds to compile the kernel, that’s a 13% time gain!
So, what can we say? That wih a good SSD drive (one which has a good controller), it’s really worth playing with these settings if you have time. For a desktop user I’m never going to do something more I/O intensive than a kernel compilation, so a permanent 10-15% gain in I/O performance is really sweet.


T’as plus qu’à traduire, mettre des obscénités et poster sur CPC… Hop hop hop.
T’es libre de tout voler la news :p
Without using the multi core capacity of your computer, I’m afraid we only have one side of the coin. Could you please give make -j2 and -j3 a try?
Bon, hop, demain matin sur Tom’s Hardware
I’m re-running all the benchmarks with a simple make and with a -j 3 too, should be online in 1-2h.
The results are actually quite surprising, more to come in another blogpost tomorrow
A noter qu’en compilant tous les i/o scheduler dans le kernel, il est facile de changer de sched io à la volée pour chaque device.
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.28.y.git;a=blob;f=Documentation/block/switching-sched.txt;h=634c952e19648b6e5474ff938208852a89a254cb;hb=HEAD
Et le temps de compilation IHMO on s’en fout dès le moment qu’on peut switcher à chaud.. quitte à compiler au moins ces deux sched et de les utiliser a bon escient.
Ok je n’avais pas lu correctement.. en fait tu compiles sur le disque SSD pour ton bench.. oublie ma 2eme remarques alors..
Good day,
I am running AuroraUX/OpenSolaris on my X301 and was wondering if there is a FW upgrade around for the SSD to get better IO out of it?
I ask as Intel and a few others have released new FW and was wondering if Samsung have also?
The only page I found was:
http://www.samsung.com/global/business/semiconductor/productInfo.do?fmly_id=161&partnum=MMCQE28G8MUP#component03
Regards,
Edward.
There is little hope about Samsung SSD’s…they are OEM units so it’s better not to hope for any update :p
YFI:
real 7m29.790s
user 6m28.216s
sys 0m54.395s
[noop] anticipatory deadline cfq
real 7m17.363s
user 6m23.140s
sys 0m53.655s
noop anticipatory deadline [cfq]
testet with x25m-g2 ssd on kernel 2.6.31-gentoo-r6
You can optimize the script and use “time” command:
time myscript.sh