# this is a 16 GB Patriot xporter XT Boost USB flash drive, lsusb claim # 2 GB, but that is understandable $ lsusb Bus 001 Device 023: ID 13fe:3100 Kingston Technology Company Inc. 2 GB USB stick
# The erase block size is clearly 8 MB, page size is not clear from this: $ sudo ./flashbench /dev/sdc -a --blocksize=1024 align 1610612736 pre 545µs on 872µs post 721µs diff 239µs align 1073741824 pre 527µs on 811µs post 659µs diff 218µs align 805306368 pre 547µs on 818µs post 673µs diff 208µs align 536870912 pre 536µs on 814µs post 664µs diff 214µs align 402653184 pre 548µs on 819µs post 666µs diff 212µs align 268435456 pre 541µs on 822µs post 673µs diff 215µs align 201326592 pre 548µs on 818µs post 658µs diff 215µs align 134217728 pre 547µs on 822µs post 651µs diff 223µs align 100663296 pre 554µs on 822µs post 654µs diff 218µs align 67108864 pre 540µs on 823µs post 662µs diff 222µs align 50331648 pre 528µs on 817µs post 644µs diff 231µs align 33554432 pre 557µs on 815µs post 672µs diff 200µs align 25165824 pre 543µs on 821µs post 680µs diff 209µs align 16777216 pre 548µs on 822µs post 675µs diff 211µs align 12582912 pre 666µs on 688µs post 660µs diff 25.3µs align 8388608 pre 543µs on 819µs post 656µs diff 219µs align 6291456 pre 658µs on 697µs post 663µs diff 36.3µs align 4194304 pre 651µs on 697µs post 656µs diff 44.2µs align 3145728 pre 668µs on 692µs post 672µs diff 21.7µs align 2097152 pre 660µs on 688µs post 673µs diff 21.2µs align 1572864 pre 664µs on 695µs post 666µs diff 30µs align 1048576 pre 669µs on 696µs post 659µs diff 32.2µs align 786432 pre 664µs on 697µs post 652µs diff 39.6µs align 524288 pre 670µs on 698µs post 656µs diff 35.1µs align 393216 pre 664µs on 697µs post 651µs diff 40µs align 262144 pre 661µs on 696µs post 667µs diff 32.6µs align 196608 pre 665µs on 695µs post 663µs diff 30.8µs align 131072 pre 657µs on 680µs post 666µs diff 18.7µs align 98304 pre 670µs on 684µs post 669µs diff 14.3µs align 65536 pre 663µs on 684µs post 660µs diff 22.3µs align 49152 pre 653µs on 895µs post 668µs diff 235µs align 32768 pre 664µs on 684µs post 669µs diff 17.7µs align 24576 pre 667µs on 685µs post 667µs diff 18.1µs align 16384 pre 652µs on 894µs post 659µs diff 239µs align 12288 pre 665µs on 685µs post 659µs diff 23.1µs align 8192 pre 653µs on 681µs post 669µs diff 20.2µs align 6144 pre 656µs on 683µs post 667µs diff 21.9µs align 4096 pre 663µs on 676µs post 672µs diff 8.79µs align 3072 pre 670µs on 670µs post 665µs diff 2.62µs align 2048 pre 661µs on 677µs post 658µs diff 17.1µs
# Optimum I/O size is 64 KB, page size looks like 32 KB effective sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=3 /dev/sdc --blocksize=4096 8MiB 15M/s 4MiB 14.9M/s 2MiB 14.9M/s 1MiB 15.4M/s 512KiB 15.7M/s 256KiB 13.1M/s 128KiB 13.1M/s 64KiB 16.4M/s 32KiB 10.9M/s 16KiB 3.12M/s 8KiB 1.67M/s 4KiB 861K/s
# six erase blocks is still fine $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=6 /dev/sdc 8MiB 15.3M/s 4MiB 14.6M/s 2MiB 14.2M/s 1MiB 14.9M/s 512KiB 15.4M/s 256KiB 13.5M/s 128KiB 12.3M/s 64KiB 16M/s 32KiB 10.6M/s 16KiB 3.16M/s
# ten erase block not so, gradual decline hints at log-structured writes: $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=10 /dev/sdc 8MiB 14.8M/s 4MiB 12.9M/s 2MiB 10.5M/s 1MiB 6.79M/s 512KiB 4.25M/s ^C
# get the stick into fast case again, by writing to it with six blocks: $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=6 /dev/sdc --blocksize=$[4 * 1024 * 1024] 8MiB 12.8M/s 4MiB 12.6M/s $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=6 /dev/sdc --blocksize=$[4 * 1024 * 1024] 8MiB 14.6M/s 4MiB 14.3M/s
# seven block still ok: $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=7 /dev/sdc --blocksize=$[1 * 1024 * 1024] 8MiB 14.3M/s 4MiB 14.4M/s 2MiB 14M/s 1MiB 14.5M/s
# eight blocks ok: $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=8 /dev/sdc --blocksize=$[32 * 1024] 8MiB 14.7M/s 4MiB 14.1M/s 2MiB 14.5M/s 1MiB 14.9M/s 512KiB 15M/s 256KiB 13.3M/s 128KiB 12M/s 64KiB 16.4M/s 32KiB 10.4M/s
# nine blocks is where we hit the wall, though 16 KB and smaller is ok: $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=9 /dev/sdc --blocksize=$[32 * 1024] 8MiB 14.7M/s 4MiB 13.9M/s 2MiB 12.3M/s 1MiB 10M/s 512KiB 7.11M/s 256KiB 4.8M/s 128KiB 2.51M/s 64KiB 1.44M/s 32KiB 726K/s 16KiB 3.02M/s 8KiB 1.51M/s 4KiB 782K/s
# resetting the device by writing 8 blocks again: $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=8 /dev/sdc --blocksize=$[4 * 1024 * 1024] 8MiB 14.6M/s 4MiB 14.6M/s
# trying eight blocks with random access, the device copes ok, but not # perfect, another indication for log-structured: $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=8 /dev/sdc --blocksize=$[4 * 1024] --random 8MiB 15M/s 4MiB 11.6M/s 2MiB 8.3M/s 1MiB 7.84M/s 512KiB 5.3M/s 256KiB 6.53M/s 128KiB 4.79M/s 64KiB 7.37M/s 32KiB 6.69M/s 16KiB 3.08M/s 8KiB 1.55M/s 4KiB 787K/s
# nine blocks random I/O: somewhat worse than 9 blocks linear, 16 KB # blocks are still as fast as always $ sudo ./flashbench --erasesize=$[8*1024*1024] --open-au --open-au-nr=9 /dev/sdc --blocksize=$[4 * 1024] --random 8MiB 14.6M/s 4MiB 11.3M/s 2MiB 7.05M/s 1MiB 4.74M/s 512KiB 3.21M/s 256KiB 1.8M/s 128KiB 1.13M/s 64KiB 694K/s 32KiB 376K/s 16KiB 2.96M/s 8KiB 1.45M/s 4KiB 739K/s
# Looking for FAT optimizations, nothing there: $ sudo ./flashbench --erasesize=$[8*1024*1024] --findfat --fat-nr=4 /dev/sdc --blocksize=$[4 * 1024] --random 8MiB 15.2M/s 16.3M/s 14.3M/s 14.1M/s 4MiB 11.4M/s 11.4M/s 11.7M/s 12M/s 2MiB 8.32M/s 8.3M/s 8.32M/s 8.41M/s 1MiB 7.93M/s 7.93M/s 7.93M/s 7.89M/s 512KiB 5.34M/s 5.32M/s 5.33M/s 5.34M/s 256KiB 6.6M/s 6.51M/s 6.6M/s 6.59M/s 128KiB 4.85M/s 4.86M/s 4.85M/s 4.85M/s 64KiB 7.48M/s 7.51M/s 7.52M/s 7.48M/s 32KiB 6.79M/s 6.91M/s 6.96M/s 6.97M/s 16KiB 3.18M/s 3.19M/s 3.2M/s 3.2M/s 8KiB 1.61M/s 1.62M/s 1.62M/s 1.61M/s 4KiB 820K/s 819K/s 812K/s 818K/s
Verdict: Decent algorithm, the stick assumes random writes when accessed with 16 KB blocks but linear writes for anything larger. Linear write performance good, even across many erase blocks.
flashbench-results@lists.linaro.org