Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-02-2006, 05:05 PM   #1
Registered: Mar 2004
Distribution: CentOS 4.3/4.5
Posts: 72

Rep: Reputation: 15
Flash write on ext3 FS stalling

I am bulding a product where I need to do fairly fast reads/writes (under 100 milliseconds for 512 bytes) to a external Secure Digital flash reader running with fairly fast Secure Digital media (133x = ~20 mB/s). All reads/writes are done from/to a single file. Right now I am using CentOS4.3 for the distro. I am using a ext3 file system with data journaling enabled and committed every second. I do not use synchronous writes. Every once in a while, my program hangs in the fstream write (I only write 512 bytes at a time by the way) for over 100 milliseconds. It happens more often if I use fstream.flush. Is there anything I can do to prevent this from happening? Does anyone here know how to use the sys file system to minimize write latency or tweak other performace characteristics? I can't seem to find any specific documentation on this. I did find something on elvtune but this only works with 2.4 kernels.

BTW, I tried this with a ext3 file system in a file on top of vfat and it never stalls. But then again I have to manually do a sync() to make sure all the data gets there which takes 300 milliseconds. Also ReiserFS or XFS are not an option since I need as many distributions as possible to be able to read/write to the media and lots of them don't have this in the kernel by default.


Update: I changed the mount to flags to synchronous. I still get writes above 100ms. Interestingly when setting the file pointer using fstream.seekg even for reads I have timeout problems over 100ms occasionally. Any ideas why?

Last edited by Denes; 08-08-2006 at 03:35 PM.
Old 08-28-2006, 12:23 PM   #2
Registered: Mar 2004
Distribution: CentOS 4.3/4.5
Posts: 72

Original Poster
Rep: Reputation: 15
After doing more research I have found the problems were due to media. If I use higher quality media, the number of accesses above 100ms is greatly reduced. It turns out that in terms of SD if you want high quality with no errors you really must go high grade.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i read and write to a ext3 partition from windows saini_mw Linux - Software 6 04-19-2006 02:07 AM
User write permissions on ext3 partition darin3200 Linux - General 4 05-30-2005 08:27 AM
Write access to ext3 from Windows? gflores Linux - Newbie 9 04-09-2005 02:41 PM
Cant write or read ext3 partitions?!?!?! wasabi Linux - General 9 06-17-2004 07:07 AM
ext3 write support from XP MrJoshua Linux - General 2 04-03-2004 11:25 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration