Page 1 of 1

Wrong SD card IO scheduler

Posted: Sun Jan 13, 2013 10:24 am
by Zielony
As Raspberry runs by default on SD card, there should be special care of IO scheduler of that device. Unfortunately I noticed today the scheduler is set to CFQ looking into /sys/block/mmcblk0/queue/scheduler. To change it do deadline I created /etc/tmpfiles.d/set_IO_scheduler.conf with such content:

Code: Select all

w /sys/block/mmcblk0/queue/scheduler - - - - deadline
I hope SD IO performance will be much better now. But in my opinion this setting should be guaranteed since pure installation.

Re: Wrong SD card IO scheduler

Posted: Sun Jan 13, 2013 11:06 am
by pepedog
I am no expert in this matter and inclined to blindly follow this
Next rootfs had/has elevator=noop in cmdline.txt so I get
cat /sys/block/mmcblk0/queue/scheduler
[noop] deadline cfq
So elevator=deadline would do it?
Hmm, noop seemed faster in my slow card

My fast card

Code: Select all

echo "deadline" > /sys/block/mmcblk0/queue/scheduler
# dd if=/dev/zero of=test bs=1M count=512
536870912 bytes (537 MB) copied, 34.6949 s, 15.5 MB/s
# echo "noop" > /sys/block/mmcblk0/queue/scheduler
# dd if=/dev/zero of=test bs=1M count=512
536870912 bytes (537 MB) copied, 35.3581 s, 15.2 MB/s
My slow card was .3 quicker too with noop
I'm still no expert on this

Re: Wrong SD card IO scheduler

Posted: Sun Jan 13, 2013 11:43 am
by Zielony
Neither I'm not an expert. I hadn't tested it before. Also with my class 10 card seems to be a bit faster with noop.

Code: Select all

root:~# echo "deadline" > /sys/block/mmcblk0/queue/scheduler
root:~# sync
root:~# dd if=/dev/zero of=test bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 14.0027 s, 9.6 MB/s
root:~# sync
root:~# echo "noop" > /sys/block/mmcblk0/queue/scheduler
root:~# sync
root:~# dd if=/dev/zero of=test bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 13.1649 s, 10.2 MB/s
If /sys/block/mmcblk0/queue/scheduler shows noop, elevator seems to work. ;)

BTW it's very nice to see that someone cares about making distro better and better.

Re: Wrong SD card IO scheduler

Posted: Sun Jan 13, 2013 2:22 pm
by pepedog
Nice to see others giving input too, even though I'm just fumbling my way around arch is very underrated. Mandriva and I think fedora has systemd, plus geexbox and possibly mer.
We have considered making larger images that would be for games/karaoke/media/dev. Foundation can't host these though.

Re: Wrong SD card IO scheduler

Posted: Wed Sep 07, 2016 10:01 pm
by dhawal
when i boot my pi up right after the colorful screen it says io scheduler deadline disabled not found and it wont let me use my gpio pins
any suggestions on how to fix??

Re: Wrong SD card IO scheduler

Posted: Wed May 16, 2018 11:34 am
by dingo35
Both SD-cards and SSD-drives perform best with the NOOP scheduler.

I take care of this by creating /etc/udev/rules.d/60-mmc-scheduler.rules :

Code: Select all

# set noop scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="noop"
# set noop scheduler for multimedia cards (SD-cards)
ACTION=="add|change", KERNEL=="mmc*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="noop"
Would it perhaps be a good idea to have this file in the default raspbian image?