Author Topic: help with SD read/write speed  (Read 18304 times)

chyang

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
    • http://mail.ustc.edu.cn/~chyang/
help with SD read/write speed
« on: March 02, 2004, 09:36:31 am »
hi, Is there anyone having tested the read/write speed of SD? I tested with a 10MB/s high speed Panasonic SD, but very disappointed to see the result is just about 200KB/s or so. Is it normal?
   Thanks.
SL-C3200+Symbol CF WIFI+Corsair 2GB SD
SL-5500+Sharp-3.13 ROM+Viking 512MB CF+Kinston 256MB SD
[img]http://sunsetyang.googlepages.com/c3200.gif\" border=\"0\" class=\"linked-sig-image\" /][img]http://sunsetyang.googlepages.com/5500.gif\" border=\"0\" class=\"linked-sig-image\" /]
Socket CF Bluetooth + EagleTec CF Lan Card + EagleTec CF Modem
Histroy:
[SL-C3000 Cacko 1.23 Beta 1] Sold on 2006/07/27
MA701 CF WIFI + EagleTec CF Bluetooth + D-Link DCF-660W WIFI
[SL5500+Sharp-3.13 ROM+SimpleTech 64MB CF+Hagiwara 128MB SD] Lost on 18,March,04

ScottYelich

  • Hero Member
  • *****
  • Posts: 992
    • View Profile
    • http://www.zaurususergroup.com/modules.php?opmodload&namephpWiki&filei
help with SD read/write speed
« Reply #1 on: March 02, 2004, 12:38:52 pm »
I\'d be happy to get 200KB/sec ... and stable SD.

I was getting 34 to 75KB/sec... and my SD would *still* go offline.

Scott

Anonymous

  • Guest
help with SD read/write speed
« Reply #2 on: March 02, 2004, 01:12:41 pm »
What are you using to test the I/O?   On what devices?

ScottYelich

  • Hero Member
  • *****
  • Posts: 992
    • View Profile
    • http://www.zaurususergroup.com/modules.php?opmodload&namephpWiki&filei
help with SD read/write speed
« Reply #3 on: March 02, 2004, 01:57:11 pm »
copying a large file... to lexar 512 mb SD ... with async on and off...

Scott
ps: I can\'t write much to the sd before it goes offline... can\'t untar... can\'t copy mp3s.... nothing.

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
help with SD read/write speed
« Reply #4 on: March 02, 2004, 02:14:25 pm »
Mounting the SD card async has no noticable effect using the standard Sharp kernel, because apparently Sharp has put in additional code in the filesystem drivers that force sync i/o on even if you mount with -o async.  When you re-compile your kernel, you can turn off the \"CONFIG_FS_SYNC\" option, and then mounting your SD or CF card async gives you at least a 10-1 improvement in write speed.  You just need to make sure that you don\'t pull it out without unmounting it first.
I\'ll go ahead an upload my kernel with this option turned off (it\'s not in the standard Linux kernel, only in Sharp\'s version).  Been running it for a month or two, without any problems.

Something else you can try in the meantime is to mount your SD card through the loopback driver, if you have a lot of data to copy to it... i.e.:
umount /dev/mmcda1
mount -oloop,noatime,async /dev/mmcda1 /mnt/card

Anonymous

  • Guest
help with SD read/write speed
« Reply #5 on: March 02, 2004, 03:16:45 pm »
I get 198.0KB/s copying to the internal storage from 256MB simpletech SD card, and 302.8KB/s copying from internal storage to simpletech SD card.  I get 349KB/s copying from simpletech SD to sandisk 256MB cf, and 312KB/s copying from CF to SD.   The numbers are from a localhost sftp 70MB transfer on an 860.

chyang

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
    • http://mail.ustc.edu.cn/~chyang/
help with SD read/write speed
« Reply #6 on: March 02, 2004, 10:08:39 pm »
I haven\'t met ScottYelich\'s problem with SD, but I have met the un-stable mmc using. The MMC card\'s read/write is so slow and I got the directory or files all in mess when I resume my Zaurus from suspend. :-(
SL-C3200+Symbol CF WIFI+Corsair 2GB SD
SL-5500+Sharp-3.13 ROM+Viking 512MB CF+Kinston 256MB SD
[img]http://sunsetyang.googlepages.com/c3200.gif\" border=\"0\" class=\"linked-sig-image\" /][img]http://sunsetyang.googlepages.com/5500.gif\" border=\"0\" class=\"linked-sig-image\" /]
Socket CF Bluetooth + EagleTec CF Lan Card + EagleTec CF Modem
Histroy:
[SL-C3000 Cacko 1.23 Beta 1] Sold on 2006/07/27
MA701 CF WIFI + EagleTec CF Bluetooth + D-Link DCF-660W WIFI
[SL5500+Sharp-3.13 ROM+SimpleTech 64MB CF+Hagiwara 128MB SD] Lost on 18,March,04

ScottYelich

  • Hero Member
  • *****
  • Posts: 992
    • View Profile
    • http://www.zaurususergroup.com/modules.php?opmodload&namephpWiki&filei
help with SD read/write speed
« Reply #7 on: March 03, 2004, 09:09:26 am »
Quote
I haven\'t met ScottYelich\'s problem with SD, but I have met the un-stable mmc using. The MMC card\'s read/write is so slow and I got the directory or files all in mess when I resume my Zaurus from suspend. :-(

I recently was going to fly for 5 hrs ... so I planned to load up my 512MB SD with mp3s.  Needless to say, I had to \"rsync\" in the mp3s.  It took 4 hours for 400+MB of MP3s.

ie: rsync, crash, eject, insert, umount, fsck, mount, repeat

To me, SD is simply not an option.  It\'s unusable.  I\'m mostly using mine as a read only source for things like mp3, etc... it\'s just a PITA to get the data there.  Ya, I have a card reader... for pc.  I can hook it up to my work w2k box, but will w2k support ext2/ext3 filesystems?

Scott

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
help with SD read/write speed
« Reply #8 on: March 03, 2004, 06:20:02 pm »
ScottYelich, if you want a quicker way to copy stuff to the SD, try the trick I mentioned above using a loopback mount.  This helps if you are writing a bunch of files, as it filters out multiple writes to the same location (i.e., the inode table).  This will reduce the write time in your example from 4 hours to about 15 minutes.  Slightly faster results will com from using a kernel compiled with the CONFIG_FS_SYNC flag turned off (see the other thread where I posted my custom kernel).

Anonymous

  • Guest
help with SD read/write speed
« Reply #9 on: March 03, 2004, 06:52:42 pm »
ScottYelich, there are drivers for w2k that can read and wirte to an ext2 filesystem.  Download one and found out that it doesint suppert ext3 though.  JP

Anonymous

  • Guest
help with SD read/write speed
« Reply #10 on: March 04, 2004, 05:27:01 am »
You may want to try the driver hiding in \"Downloads\" section. It may help with some of the  problems mentioned (such as SD read speed, lost card on resume). Please, note that it will only run on SL5500 (SL5000) with 2.4.18(19?) kernels.

maslovsky

  • Hero Member
  • *****
  • Posts: 1426
    • View Profile
    • http://my-zaurus.narod.ru
help with SD read/write speed
« Reply #11 on: March 04, 2004, 06:58:41 am »
Quote
I get 198.0KB/s copying to the internal storage from 256MB simpletech SD card, and 302.8KB/s copying from internal storage to simpletech SD card.  I get 349KB/s copying from simpletech SD to sandisk 256MB cf, and 312KB/s copying from CF to SD.   The numbers are from a localhost sftp 70MB transfer on an 860.

With my own kernel built with CONFIG_FS_SYNC  off, I more than 1 Mb/s transfer rate to SD/Cf cards.

Internal storage is till between 200-300 Kb/s though. I don\'t know if that\'s because NAND flash memory is so slow or there are still some places in the kernel left that cause internal storage to be monted aith sync option.

ciro

  • Newbie
  • *
  • Posts: 17
    • View Profile
help with SD read/write speed
« Reply #12 on: March 04, 2004, 07:17:21 am »
sa1100 models & pxa modles do  have pretty much different hardware. We should expect different performance. Also CONFIG_FS_SYNC is not the only thing which keeps filesystem cache from working. As for 5500 Sharp roms, there\'s a daemon called \"shsync\" which calls sync() every 5 seconds. In addition, filesystem caches get invalidated before suspend (did you see the \"invalidate: busy buffer message\"?). I don\'t know any good reason for that.

chyang

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
    • http://mail.ustc.edu.cn/~chyang/
help with SD read/write speed
« Reply #13 on: March 04, 2004, 08:25:06 am »
Quote
Quote
I get 198.0KB/s copying to the internal storage from 256MB simpletech SD card, and 302.8KB/s copying from internal storage to simpletech SD card.  I get 349KB/s copying from simpletech SD to sandisk 256MB cf, and 312KB/s copying from CF to SD.   The numbers are from a localhost sftp 70MB transfer on an 860.

With my own kernel built with CONFIG_FS_SYNC  off, I more than 1 Mb/s transfer rate to SD/Cf cards.

Internal storage is till between 200-300 Kb/s though. I don\'t know if that\'s because NAND flash memory is so slow or there are still some places in the kernel left that cause internal storage to be monted aith sync option.
Is there something wrong? The internal storage should be based on SDRAM for SL5500.
SL-C3200+Symbol CF WIFI+Corsair 2GB SD
SL-5500+Sharp-3.13 ROM+Viking 512MB CF+Kinston 256MB SD
[img]http://sunsetyang.googlepages.com/c3200.gif\" border=\"0\" class=\"linked-sig-image\" /][img]http://sunsetyang.googlepages.com/5500.gif\" border=\"0\" class=\"linked-sig-image\" /]
Socket CF Bluetooth + EagleTec CF Lan Card + EagleTec CF Modem
Histroy:
[SL-C3000 Cacko 1.23 Beta 1] Sold on 2006/07/27
MA701 CF WIFI + EagleTec CF Bluetooth + D-Link DCF-660W WIFI
[SL5500+Sharp-3.13 ROM+SimpleTech 64MB CF+Hagiwara 128MB SD] Lost on 18,March,04

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
help with SD read/write speed
« Reply #14 on: March 04, 2004, 08:40:04 am »
The shsync daemon is fine, even with it running you will still filter out most of the redundant writes (i.e., when you  are writing a bunch of files, the inode table gets written / rewritten multiple times.  With async io, only the last update to a particular sector will actually be written out to the device).  Also, since sync runs in the background, you are still getting buffered writes even when it is kicked off.
As for invalidating the buffer on suspend... The kernel normally will mark all cached data as no longer valid when you suspend, in case someone swaps out a storage device while the system is suspended.  If it didn\'t invalidate the buffers, then you would get filesystem corruption if you suspended, swaped your CF /SD card, then resumed and wrote out something.  The error message itself (busy buffer) just means that a program was reading from the device at the time the kernel tried to invalidate the buffers.  A search on linux-kernel mailing list shows that this message is usually harmless.