On Monday 21 March 2011, Philippe De Muyter wrote:
Hello Arnd,
Here are the results for the Kingston CF 2GB (Assy in TAIWAN). The one marked with (Assy in Japan) have another size, and probabbly other characteristics. Could the size be related to the number of open-au's ?
There could be any number of differences between cards from the same manufacturer if they changed the controlle chip.
/dev/sdb:
Model=CF CARD 2GB, FwRev=20071116, SerialNo=CF 2GB 20051F71 Config={ HardSect NotMFM Fixed DTR>10Mbs } RawCHS=3933/16/63, TrkSize=0, SectSize=576, ECCbytes=4 BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=off CurCHS=3933/16/63, CurSects=3964464, LBA=yes, LBAsects=3964464 IORDY=no, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: *mdma0 mdma1 mdma2 AdvancedPM=no
- signifies the current active mode
I have not completely understood the logic that Linux uses to select the best transfer mode. Apparently, this card is able to do MDMA2, but is configured for MDMA0.
3 sched_setscheduler: Operation not permitted 1MiB 11.1M/s 512KiB 11.1M/s 256KiB 11.1M/s 128KiB 11.1M/s 64KiB 10.8M/s 32KiB 10.1M/s 16KiB 8.85M/s 4 sched_setscheduler: Operation not permitted 1MiB 11.1M/s 512KiB 8.32M/s 256KiB 4.56M/s 128KiB 2.39M/s
Ok, very clear.
tmp179:~ # for i in `seq 1 10`; do echo $i; ./flashbench --open-au --open-au-nr=$i --erasesize=$[1024 * 1024] --blocksize=16384 /dev/sdb --random; done 1 sched_setscheduler: Operation not permitted 1MiB 11.1M/s 512KiB 11.1M/s 256KiB 7.38M/s 128KiB 6.18M/s 64KiB 6.12M/s 32KiB 6.47M/s 16KiB 7.04M/s 2 sched_setscheduler: Operation not permitted 1MiB 7.37M/s 512KiB 8.05M/s 256KiB 6.72M/s 128KiB 6.4M/s 64KiB 6.53M/s 32KiB 6.55M/s 16KiB 7.04M/s 3 sched_setscheduler: Operation not permitted 1MiB 8.66M/s 512KiB 9.11M/s 256KiB 6.79M/s 128KiB 5.55M/s 64KiB 4.24M/s 32KiB 4.05M/s 16KiB 3.92M/s
My interpretation of this is that the card uses a log-structured area for staging the writes here, at least in some cases. It needs to write all data twice to get it into the right order, hence the peak rate of about half of what it could get (6.5 MB/s).
As you go to more blocks, it needs to garbage-collect more often, but it does not get to a strict cut-off point like the linear measurement.
(reverse-i-search)`fat': ./flashbench --findfat --^Ct-nr=10 --erasesize=$[2 * 1024 * 1024] --blocksize=1024 /dev/sdb tmp179:~ # ./flashbench --findfat --fat-nr=10 --erasesize=$[1024 * 1024] --blocksize=1024 /dev/sdb sched_setscheduler: Operation not permitted 1MiB 4.32M/s 11.4M/s 11.4M/s 11.4M/s 11.4M/s 11.2M/s 11.3M/s 11.4M/s 11.3M/s 11.4M/s 512KiB 11.3M/s 11.4M/s 11.1M/s 11.4M/s 11.4M/s 11.4M/s 11.4M/s 11.4M/s 11M/s 11.4M/s 256KiB 11.4M/s 11.4M/s 11.2M/s 11.2M/s 11.2M/s 11.2M/s 11.3M/s 11.4M/s 11.4M/s 11.3M/s 128KiB 11.3M/s 11.3M/s 11.2M/s 11.4M/s 11.4M/s 11.4M/s 11.4M/s 11.2M/s 11.3M/s 11.4M/s 64KiB 11M/s 11M/s 11M/s 11M/s 10.8M/s 11M/s 11M/s 11M/s 11M/s 11M/s 32KiB 9.98M/s 10.3M/s 10.3M/s 10.3M/s 10.2M/s 10.1M/s 10.2M/s 10.2M/s 10.2M/s 10.3M/s 16KiB 8.99M/s 9.01M/s 9.01M/s 8.99M/s 8.94M/s 9.02M/s 9.03M/s 9.03M/s 9.01M/s 8.95M/s 8KiB 7.2M/s 7.23M/s 7.23M/s 7.22M/s 7.21M/s 7.23M/s 7.13M/s 7.23M/s 7.23M/s 7.22M/s 4KiB 4.98M/s 4.97M/s 4.83M/s 4.97M/s 4.97M/s 4.97M/s 4.92M/s 4.91M/s 4.93M/s 4.93M/s 2KiB 3.04M/s 3.06M/s 3.05M/s 3.06M/s 3.05M/s 3.06M/s 3.03M/s 3.06M/s 3.06M/s 3.06M/s 1KiB 1.26M/s 1.26M/s 1.26M/s 1.26M/s 1.25M/s 1.26M/s 1.26M/s 1.24M/s 1.26M/s 1.25M/s tmp179:~ # ./flashbench --findfat --fat-nr=10 --erasesize=$[1024 * 1024] --blocksize=1024 /dev/sdb sched_setscheduler: Operation not permitted 1MiB 11.2M/s 11.4M/s 11.4M/s 11.3M/s 11.4M/s 11.4M/s 11.4M/s 11.3M/s 11.4M/s 11.4M/s 512KiB 11.4M/s 11.2M/s 11.4M/s 11.4M/s 11.4M/s 11.4M/s 11.4M/s 11.4M/s 11.2M/s 11.3M/s 256KiB 11M/s 11.4M/s 11.4M/s 11.3M/s 11.4M/s 11.3M/s 11.1M/s 11.4M/s 11.4M/s 11M/s 128KiB 11.4M/s 11.2M/s 11.3M/s 11.4M/s 11.4M/s 11.3M/s 11.4M/s 11.3M/s 11.4M/s 11.3M/s 64KiB 11M/s 11M/s 11M/s 10.9M/s 11M/s 11M/s 11M/s 11M/s 11M/s 11M/s 32KiB 10.1M/s 10.2M/s 10M/s 10.4M/s 10.3M/s 10.3M/s 10.3M/s 10.3M/s 10.1M/s 10.3M/s 16KiB 9.03M/s 8.82M/s 9.02M/s 8.93M/s 8.94M/s 9.01M/s 9.03M/s 9M/s 9.02M/s 9.01M/s 8KiB 7.24M/s 7.22M/s 7.23M/s 7.21M/s 7.22M/s 7.17M/s 7.24M/s 7.23M/s 7.22M/s 7.23M/s 4KiB 4.97M/s 4.98M/s 4.92M/s 4.93M/s 4.84M/s 4.99M/s 4.97M/s 4.96M/s 4.97M/s 4.96M/s 2KiB 3.01M/s 3.06M/s 3.06M/s 2.97M/s 3.05M/s 3.03M/s 3.03M/s 3.05M/s 3.06M/s 3.05M/s 1KiB 1.26M/s 1.26M/s 1.26M/s 1.26M/s 1.26M/s 1.26M/s 1.26M/s 1.25M/s 1.24M/s 1.26M/s tmp179:~ #
Nothing to see here, except for the page size, which seems to be 2 KB, i.e. relatively small.
Note that this test case is more useful with the --random argument: A lot of cards that can not efficiently do random access on most of the medium can actually do it in some area at the start.
Added to the wiki, thanks!
Arnd