On Wednesday 13 July 2011, Peter Warasin wrote:
==> /sys/block/mmcblk0/device/manfid <== 0x000003
==> /sys/block/mmcblk0/device/oemid <== 0x5344
This is a Sandisk controller.
$ fdisk -lu /dev/sda
Disk /dev/sda: 15.9 GB, 15931539456 bytes 128 heads, 32 sectors/track, 7596 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x00000000
Device Boot Start End Blocks Id System /dev/sda1 1 614399 307199+ 83 Linux /dev/sda2 614400 819199 102400 83 Linux /dev/sda3 819200 1851391 516096 82 Linux swap / Solaris /dev/sda4 1851392 7364607 2756608 83 Linux
Another oddity that occasionally comes up:
Note how the size is a multiple of 1.5 MB but not 2 MB!
$ factor 15931539456 15931539456: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 7 1447 $ echo $[15931539456 / 7 / 1447] 1572864
This card must have 1.5 MB erase blocks! On all SD cards, the total size is a multiple of the erase block size, so yet another way of guessing the correct size is looking at the prime factors of the size.
$ ./flashbench -a /dev/sda3 --count=100 --blocksize=2048 align 134217728 pre 740µs on 740µs post 741µs diff -643ns align 67108864 pre 736µs on 737µs post 736µs diff 1.03µs align 33554432 pre 738µs on 742µs post 740µs diff 3.61µs align 16777216 pre 827µs on 816µs post 738µs diff 33.7µs align 8388608 pre 789µs on 810µs post 775µs diff 28.5µs align 4194304 pre 737µs on 738µs post 738µs diff 24ns align 2097152 pre 736µs on 737µs post 739µs diff -234ns align 1048576 pre 736µs on 734µs post 734µs diff -1177ns align 524288 pre 735µs on 735µs post 737µs diff -1214ns align 262144 pre 739µs on 735µs post 731µs diff -224ns align 131072 pre 737µs on 737µs post 738µs diff -650ns align 65536 pre 738µs on 736µs post 736µs diff -689ns align 32768 pre 735µs on 738µs post 732µs diff 4.52µs align 16384 pre 737µs on 738µs post 737µs diff 534ns align 8192 pre 736µs on 737µs post 736µs diff 1.38µs align 4096 pre 738µs on 732µs post 735µs diff -4358ns
-> aeh?
If the erase block size is a multiple of three, the test does not work any more. It could work with
./flashbench -a /dev/sda3 --count=100 --blocksize=1536
./flashbench /dev/sda3 --open-au-nr=5 -O --blocksize=2048 --erasesize=$[16*1024*1024] 16MiB 5.94M/s 8MiB 4.92M/s 4MiB 4.33M/s 2MiB 4.54M/s 1MiB 5.98M/s 512KiB 5.95M/s 256KiB 5.94M/s 128KiB 5.53M/s 64KiB 5.92M/s 32KiB 5.42M/s 16KiB 4.65M/s 8KiB 2.67M/s 4KiB 1.67M/s 2KiB 917K/s
$ ./flashbench /dev/sda3 --open-au-nr=10 -O --blocksize=2048 --erasesize=$[16*1024*1024] 16MiB 5.79M/s 8MiB 5.28M/s 4MiB 4.25M/s 2MiB 3.05M/s 1MiB 2.04M/s 512KiB 1.02M/s 256KiB 515K/s freezes
./flashbench /dev/sda3 --open-au-nr=6 -O --blocksize=2048 --erasesize=$[16*1024*1024] 16MiB 5.5M/s 8MiB 5.06M/s 4MiB 4.29M/s 2MiB 3.1M/s 1MiB 2.08M/s 512KiB 1.03M/s 256KiB 518K/s ^C
-> at least 5 blocks
Probably more, but you will have to pass the right size. I never implemented easy support for this in flashbench, but you can work around it by passing an odd blocksize along with the erasesize:
./flashbench /dev/sda3 --open-au-nr=4 -O --blocksize=1536 --erasesize=$[1536*1024]
./flashbench /dev/sda3 --open-au-nr=1 -O --blocksize=2048 --erasesize=$[16*1024*1024] --random 16MiB 4.65M/s 8MiB 4.69M/s 4MiB 4.65M/s 2MiB 4.71M/s 1MiB 3.66M/s 512KiB 1.75M/s 256KiB 1.28M/s 128KiB 819K/s 64KiB 542K/s 32KiB 262K/s 16KiB 127K/s 8KiB 64.4K/s
-> quite slow on small blocks
Yes, what I guess this means is that you exceed the number of 1.5MB erase blocks inside of the 16MB region you test. Probably the actual number is less than 10, consequently.
Arnd