On Monday 07 March 2011, Philippe De Muyter wrote:
On Mon, Mar 07, 2011 at 06:03:05PM +0100, Arnd Bergmann wrote:
Here are the results :
tmp179:/home/lcr/flashbench # ./flashbench -a -b 8192 /dev/sdb sched_setscheduler: Operation not permitted align 67108864 pre 1.49ms on 1.49ms post 1.49ms diff -2556ns align 33554432 pre 1.49ms on 1.49ms post 1.49ms diff -1001ns align 16777216 pre 1.49ms on 1.49ms post 1.49ms diff 1.29µs align 8388608 pre 1.49ms on 1.49ms post 1.48ms diff 1.52µs
The -a tests are still inconclusive. What kind of device is this? What is the total size? (in /proc/partitions) For a USB device, what is the output of lsusb? For a SD card, can you put the card into a builtin SD card reader and do 'head /sys/block/mmcblk0/device/*'?
tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=3 --erasesize=$[8 * 1024 * 1024] /dev/sdb sched_setscheduler: Operation not permitted 8MiB 2.7M/s 4MiB 4.44M/s 2MiB 5.06M/s 1MiB 5.32M/s 512KiB 5.48M/s 256KiB 5.51M/s 128KiB 5.53M/s 64KiB 5.46M/s 32KiB 5.3M/s 16KiB 4.99M/s tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=4 --erasesize=$[8 * 1024 * 1024] /dev/sdb sched_setscheduler: Operation not permitted 8MiB 3.42M/s 4MiB 4.72M/s 2MiB 5.18M/s 1MiB 5.38M/s 512KiB 5.12M/s 256KiB 4.06M/s 128KiB 2.89M/s 64KiB 1.8M/s 32KiB 1.02M/s 16KiB 546K/s
This at least is a clear result: The device can have 3 AUs open simultaneously, but not four. The performance using 512 KiB byte blocks is still ok, so the AU size might actually be as small as this.
tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=1 --erasesize=$[8 * 1024 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 8MiB 5.57M/s 4MiB 5.57M/s 2MiB 5.57M/s 1MiB 5.57M/s 512KiB 5.09M/s 256KiB 4.39M/s 128KiB 4.31M/s 64KiB 3.57M/s 32KiB 3.18M/s 16KiB 2.66M/s tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=2 --erasesize=$[8 * 1024 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 8MiB 5.2M/s 4MiB 5.39M/s 2MiB 5.53M/s 1MiB 5.53M/s 512KiB 4.79M/s 256KiB 3.95M/s 128KiB 3.37M/s 64KiB 2.49M/s 32KiB 1.95M/s 16KiB 1.48M/s
In random access, you see the performance drop already with one AU, which is a hint that the AU size is actually smaller. What you could try next is vary the erasesize argument with --random --open-au-nr=3.
When you pass the correct size, you should see the same result that you see without --random, i.e. it's always fast with --open-au-nr=3 but much slower with --open-au-nr=4.
Arnd