On Monday 20 February 2012, Andrew Bradford wrote:
9 open erase blocks! Looks like a rather nice microSD card, compared to others I've seen.
Yes, much better than the others you sent, definitely. All the others fall into the "unusable" category, this has some potential ;-)
andrew@bigbox:~/flashbench$ sudo sfdisk -uS -l /dev/sdc
Disk /dev/sdc: 1890 cylinders, 128 heads, 32 sectors/track Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
/dev/sdc1 * 8192 7741439 7733248 c W95 FAT32 (LBA) /dev/sdc2 0 - 0 0 Empty /dev/sdc3 0 - 0 0 Empty /dev/sdc4 0 - 0 0 Empty
factor $[(7741439 + 1) / 2] 3870720: 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 5 7
This could be either 945 * 4 MB or 630 * 6 MB
andrew@bigbox:~/flashbench$ sudo ./flashbench -a /dev/sdc --blocksize=1024 --count=100 align 1073741824 pre 872µs on 921µs post 873µs diff 48.5µs align 536870912 pre 872µs on 973µs post 871µs diff 102µs align 268435456 pre 872µs on 935µs post 872µs diff 63.5µs align 134217728 pre 1ms on 1.04ms post 1ms diff 40.1µs align 67108864 pre 966µs on 1.07ms post 976µs diff 97.7µs align 33554432 pre 1ms on 1.07ms post 1.01ms diff 63.6µs align 16777216 pre 999µs on 1.09ms post 1.01ms diff 86.7µs align 8388608 pre 999µs on 1.03ms post 1ms diff 32.3µs align 4194304 pre 1.03ms on 1.12ms post 1.03ms diff 95.6µs align 2097152 pre 999µs on 1.1ms post 1.03ms diff 88.8µs align 1048576 pre 1.01ms on 1.04ms post 1.01ms diff 34.9µs align 524288 pre 1.01ms on 1.03ms post 1.02ms diff 18.4µs align 262144 pre 1.01ms on 1.02ms post 986µs diff 28.5µs align 131072 pre 1ms on 1.03ms post 1.01ms diff 26.9µs align 65536 pre 1ms on 1.03ms post 1.01ms diff 27.1µs align 32768 pre 985µs on 1.03ms post 1ms diff 32.2µs align 16384 pre 986µs on 982µs post 966µs diff 5.55µs align 8192 pre 1.01ms on 1ms post 1.01ms diff -9139ns align 4096 pre 981µs on 1.03ms post 1.04ms diff 25.9µs align 2048 pre 974µs on 977µs post 973µs diff 3.65µs
## 2MiB erase block ## 8KiB pages? hard to see
I would rerun this with --blocksize=3072, there might be more to see if in case this has a multiple of 3 in it.
andrew@bigbox:~/flashbench$ sudo ./flashbench /dev/sdc --open-au --erasesize=$[2*1024*1024] --blocksize=$[4*1024] --open-au-nr=9 2MiB 12.8M/s 1MiB 11M/s 512KiB 12.4M/s 256KiB 12.2M/s 128KiB 11.5M/s 64KiB 10.3M/s 32KiB 8.57M/s 16KiB 6.33M/s 8KiB 3.37M/s 4KiB 1.6M/s
andrew@bigbox:~/flashbench$ sudo ./flashbench /dev/sdc --open-au --erasesize=$[2*1024*1024] --blocksize=$[4*1024] --open-au-nr=10 2MiB 13M/s 1MiB 6.88M/s 512KiB 2.41M/s 256KiB 1.1M/s 128KiB 531K/s 64KiB 263K/s 32KiB 130K/s 16KiB 64.8K/s 8KiB 302K/s 4KiB 346K/s
# 9 open-au has same performance as 2 open-au.
very nice, yes.
andrew@bigbox:~/flashbench$ sudo ./flashbench /dev/sdc --open-au --erasesize=$[2*1024*1024] --blocksize=$[4*1024] --random --open-au-nr=9 2MiB 10.4M/s 1MiB 12.6M/s 512KiB 12.1M/s 256KiB 3.54M/s 128KiB 1.18M/s 64KiB 647K/s 32KiB 310K/s 16KiB 180K/s 8KiB 820K/s 4KiB 928K/s
With the numbers like this, my guess is that it can in fact do 9 erase blocks of some other size, possibly as small as 512KB using the sandisk trick where they write all bits at once to turn an 1.5MB TLC block into a 0.5MB SLC block.
Maybe you can try playing with the offset to find the correct erase block size. If 512KB gives you the full 12MB/s in linear mode with open-au-nr=9, try misaligning this:
# natural alignment (start at default of 16MB) sudo ./flashbench /dev/sdc --open-au --erasesize=$[512*1024] \ --blocksize=65536 --open-au-nr=9
# offset by one erase block, should still be fast sudo ./flashbench /dev/sdc --open-au --erasesize=$[512*1024] \ --blocksize=65536 --open-au-nr=9 --offset=$[18 * 1024 * 1024 + 512 * 1024]
# offset by half an erase block, only fast if actual block size is larger than 512KB sudo ./flashbench /dev/sdc --open-au --erasesize=$[512*1024] \ --blocksize=65536 --open-au-nr=9 --offset=$[18 * 1024 * 1024 + 256 * 1024]
# offset by half an erase block backwards, should be slow sudo ./flashbench /dev/sdc --open-au --erasesize=$[512*1024] \ --blocksize=65536 --open-au-nr=9 --offset=$[18 * 1024 * 1024 - 256 * 1024]
Arnd