SD card performace ?

Harald Koenig koenig at
Mon Aug 4 10:54:37 CEST 2008


some questions about SD card performace, right now running 

     # cat /proc/version 
     Linux version 2.6.24 (oe at (gcc version 4.1.2) #1 PREEMPT Wed Jul 30 11:56:48 CEST 2008

but with older (pre-GPS-fix) kernel I've seen similar read performace (haven't 
looked at write performace before the GPS-fix.

a) read performace

in my gta02v5 I get ~3.2 MB/sec sustained read performace with the 
shipped 512 MB sandisk card using e.g.

	dd_rescue /dev/mmcblk0 /dev/null

when I do the same with this card in my Lenovo T61p (builtin sd card reader)
I get ~7.5 MB/sec.   is there a chance to get better read performace ?

reading from /dev/mtdblock6 (the internal jffs2 partition?) I also get ~3.2 MB/sec

any chance to get better read performace (both for SD and the internal flash)? 
what's the limiting factor ?

one term seems to be the block size (cp uses 4k I/O blocks):

# time dd if=/bin/bash of=/media/mmcblk0p2/bin/bash  bs=4k  
real    0m3.952s

# time dd if=/bin/bash of=/media/mmcblk0p2/bin/bash  bs=64k
real    0m3.020s

# time dd if=/bin/bash of=/media/mmcblk0p2/bin/bash  bs=1k
real    0m7.923s

# time dd if=/bin/bash of=/media/mmcblk0p2/bin/bash  bs=1b
real    0m10.912s

is this really the max. cpu/system performace for a 400 MHz arm ?

talking about cpu performace:  a first naiive read-test for /bin/bash
obviously was cpu bound (again, only ~1.4 MB/sec for 400 MHz?!):

	# time wc -l /bin/bash 
	     9274 /bin/bash

	real    0m0.464s
	user    0m0.400s
	sys     0m0.030s

but dd shows reasonable read timing (cached):

	# time dd if=/bin/bash  of=/dev/null  bs=4k
	160+1 records in
	160+1 records out

	real    0m0.038s
	user    0m0.010s
	sys     0m0.020s

b) write performace

I just did a 

	# ls -l /bin/bash
	-rwxr-xr-x    1 root     root       659028 Jun 22 02:12 /bin/bash
	# time cp /bin/bash /media/mmcblk0p2/bin/bash

and was surprised that this takes 3.9 to 4.2 seconds for _every_ run 
(no caching effect for 2nd run). /bin/ is the internal flash jffs2, 
/media/mmcblk0p2/ is ext3.  

any comments (for performace fixes;-) ?


"I hope to die                                      ___       _____
before I *have* to use Microsoft Word.",           0--,|    /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.        <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig                                           //  /     \\  \
koenig at                     ^^^^^       ^^^^^

More information about the devel mailing list