On Tuesday 15 March 2011, Philippe De Muyter wrote:
On Tue, Mar 15, 2011 at 02:48:43PM +0100, Arnd Bergmann wrote:
tmp179:~ # ./flashbench --findfat --fat-nr=10 --erasesize=$[1024 * 1024] /dev/sdb --random --blocksize=512 sched_setscheduler: Operation not permitted 1MiB 5.45M/s 5.53M/s 5.55M/s 5.55M/s 5.54M/s 5.55M/s 4.77M/s 4.77M/s 4.44M/s 4.77M/s 512KiB 5.04M/s 5.2M/s 5.04M/s 4.79M/s 4.92M/s 4.92M/s 4.61M/s 4.61M/s 4.85M/s 4.85M/s 256KiB 4.4M/s 4.44M/s 4.6M/s 4.47M/s 4.91M/s 4.92M/s 4.6M/s 4.6M/s 4.6M/s 4.61M/s 128KiB 4.31M/s 4.69M/s 4.57M/s 4.57M/s 4.57M/s 4.57M/s 4.41M/s 4.52M/s 4.59M/s 4.66M/s 64KiB 4.74M/s 4.59M/s 4.66M/s 4.64M/s 4.66M/s 4.66M/s 4.64M/s 4.64M/s 4.61M/s 4.64M/s 32KiB 4.46M/s 4.45M/s 4.47M/s 4.47M/s 4.45M/s 4.47M/s 4.46M/s 4.47M/s 4.44M/s 4.45M/s 16KiB 4.27M/s 4.28M/s 4.28M/s 4.28M/s 4.27M/s 4.27M/s 4.27M/s 4.21M/s 4.27M/s 4.27M/s 8KiB 3.31M/s 3.35M/s 3.35M/s 3.34M/s 3.35M/s 3.32M/s 3.35M/s 3.35M/s 3.35M/s 3.35M/s 4KiB 2.33M/s 2.33M/s 2.33M/s 2.33M/s 2.33M/s 2.33M/s 2.33M/s 2.33M/s 2.33M/s 2.33M/s 2KiB 1.44M/s 1.43M/s 1.43M/s 1.43M/s 1.43M/s 1.43M/s 1.42M/s 1.43M/s 1.43M/s 1.43M/s 1KiB 798K/s 799K/s 801K/s 800K/s 799K/s 798K/s 801K/s 799K/s 800K/s 800K/s 512B 423K/s 422K/s 423K/s 422K/s 423K/s 422K/s 423K/s 422K/s 424K/s 423K/s tmp179:~ #
Ok, it seems that the page size 4 KB here, since writing anything smaller than 4 KB gets only half the performance, i.e. it takes the same time to write the entire 4 KB page as it takes to write only 512 bytes when the raw NAND writes 4 KB anyway.
No problem. Do you describe somewhere, or better, let flashbench implement it, the steps to test a card ?
I should extend the README file that comes with flashbench, but haven't gotten to that. The basic steps are always:
1. find out erase block size 2. find number of open erase blocks (random and linear) 3. find possible FAT optimized area 4. get identification from card (name, size, usb id) where applicable
Here are the first results for "Kingston 4GB 133X elite pro CF/4GB-S2":
tmp179:~ # cat /proc/partitions major minor #blocks name 8 32 3940272 sdc 8 33 3936240 sdc1 tmp179:~ # ./flashbench -a -b 1024 /dev/sdc sched_setscheduler: Operation not permitted align 134217728 pre 507µs on 760µs post 481µs diff 266µs align 67108864 pre 504µs on 754µs post 481µs diff 262µs align 33554432 pre 505µs on 753µs post 479µs diff 261µs align 16777216 pre 506µs on 753µs post 480µs diff 260µs align 8388608 pre 506µs on 754µs post 479µs diff 261µs align 4194304 pre 505µs on 758µs post 479µs diff 266µs align 2097152 pre 505µs on 756µs post 480µs diff 263µs align 1048576 pre 505µs on 673µs post 485µs diff 178µs align 524288 pre 510µs on 671µs post 484µs diff 174µs align 262144 pre 506µs on 674µs post 483µs diff 180µs align 131072 pre 507µs on 666µs post 486µs diff 170µs align 65536 pre 497µs on 668µs post 478µs diff 181µs align 32768 pre 503µs on 666µs post 480µs diff 174µs align 16384 pre 497µs on 668µs post 481µs diff 179µs align 8192 pre 503µs on 666µs post 478µs diff 176µs align 4096 pre 493µs on 491µs post 489µs diff 171ns align 2048 pre 481µs on 487µs post 489µs diff 2.21µs
Excellent: Here you can see very clearly by looking at the final column that the card has a 2 MB erase block size and a 4 KB page size.
Doing the tests --findfat and --open-au tests with --erasesize=$[2 * 1024 * 1024] and --blocksize=4096 should be very straightforward on this one. My personal guess from having worked with Kingston SD cards is that that it will be much worse than the Transcend card.
Arnd