On Wednesday 13 July 2011, Peter Warasin wrote:
Hi guys
also a good card
looks like same manfid and controller like the first filemate card in your list
Ah, I wondered about this. I also had a Sandisk-labelled card with the same controller and name "LEXAR", so this is probably the same hardware. Sandisk also confirmed to me that the card I had was not an authentic Sandisk card.
==> /sys/block/mmcblk0/device/oemid <== 0x4245
"BE", same as the other 0x0028 manfid cards
$ ./flashbench -a /dev/sda3 --count=100 --blocksize=2048 align 134217728 pre 722µs on 853µs post 722µs diff 131µs align 67108864 pre 724µs on 857µs post 724µs diff 133µs align 33554432 pre 726µs on 853µs post 724µs diff 128µs align 16777216 pre 724µs on 853µs post 721µs diff 131µs align 8388608 pre 721µs on 845µs post 717µs diff 126µs align 4194304 pre 722µs on 726µs post 722µs diff 3.42µs align 2097152 pre 726µs on 726µs post 724µs diff 1.07µs align 1048576 pre 725µs on 728µs post 728µs diff 2.17µs align 524288 pre 729µs on 729µs post 729µs diff -275ns align 262144 pre 727µs on 728µs post 727µs diff 541ns align 131072 pre 723µs on 725µs post 727µs diff 542ns align 65536 pre 722µs on 720µs post 721µs diff -1576ns align 32768 pre 728µs on 726µs post 727µs diff -1480ns align 16384 pre 719µs on 721µs post 713µs diff 5.35µs align 8192 pre 724µs on 730µs post 729µs diff 3.25µs align 4096 pre 727µs on 727µs post 731µs diff -1882ns
-> 8MiB erase-block size
Yes, this is a strong indication.
$ ./flashbench --open-au --open-au-nr=1 --erasesize=$[16*1024*1024] --blocksize=$[1024*1024] /dev/sda3 16MiB 8.99M/s 8MiB 14.5M/s 4MiB 15M/s 2MiB 15.1M/s 1MiB 16M/s
-> ok, definitively 8MiB erase-block size
This is not a strong indication, all you can see from this is that the first write was slower, but that can be because it did a garbage-collection before.
$ ./flashbench --open-au --open-au-nr=5 --erasesize=$[8*1024*1024] --blocksize=2048 /dev/sda3 8MiB 14.7M/s 4MiB 9.31M/s 2MiB 14.9M/s 1MiB 15.5M/s 512KiB 15.7M/s 256KiB 15.1M/s 128KiB 14.7M/s 64KiB 13.6M/s 32KiB 10.7M/s 16KiB 7.17M/s 8KiB 4.34M/s 4KiB 2.21M/s 2KiB 1.14M/s
$ ./flashbench --open-au --open-au-nr=6 --erasesize=$[8*1024*1024] --blocksize=$[1024*1024] /dev/sda3 8MiB 14.8M/s 4MiB 4.07M/s 2MiB 2.34M/s 1MiB 1.28M/s
-> can handle 5 blocks concurrently
Yes.
$ ./flashbench --open-au --open-au-nr=10 --erasesize=$[8*1024*1024] --blocksize=2048 /dev/sda3 8MiB 14.8M/s 4MiB 4.91M/s 2MiB 2.33M/s 1MiB 1.28M/s 512KiB 671K/s ^C
$ ./flashbench --open-au --open-au-nr=20 --erasesize=$[8*1024*1024] /dev/sda3 8MiB 13.7M/s 4MiB 4.11M/s ^C
$ ./flashbench --open-au --open-au-nr=40 --erasesize=$[8*1024*1024] /dev/sda3 8MiB 14.3M/s 4MiB 4M/s ^C
$ ./flashbench --open-au --open-au-nr=100 --erasesize=$[8*1024*1024] /dev/sda3 8MiB 13.6M/s ^C
$ ./flashbench --open-au --open-au-nr=300 --erasesize=$[8*1024*1024] /dev/sda3 8MiB 14.7M/s ^C
-> is this some sort of caching?
No. What happens is that every write access is a whole erase block, so the card never has to do any garbage-collection. In the last run, flashbench will pick 300 8MB erase blocks (every 6th with the latest version), and write full 8 MB to each, overwriting whatever was there before.
The second row of each test, flashbench writes the first 4MB of each 8MB block, then writes the other 4 MB. If you do this for more than 5 erase blocks on this card, it will garbage-collect the first block by copying the remaining 4 MB in order to 'close' that erase block and start writing to the sixth one. So instead of 'write 4MB; write 4MB', the card does 'write 4MB; read 4MB; write 4MB; write 4MB; read 4 MB; write 4MB', which roughly triples the time to write a total of 8 MB for the case where it writes more than 5 segments compared to up to 5 segments.
This gets much worse for smaller blocks, where 2048*(write 4KB) turns into 2048*(write 4KB; read 8188 KB; write 8188KB).
See https://lwn.net/Articles/428799/ "SSD thrashing".
Arnd