Hello all, I have a small system with an Intel StrongArm processor running a
2.4.11 kernel. This board contains both a DiskOnChip as well as a CF for non-voltaile storage. The root file system is in a separte flash chip, the DOC is mounted as ext2, and the CF is mounted as vfat. The DOC and CF cards are used for applications/general purpose data storage.In my application, I need to store streaming data to disk (i.e. CF or DOC), at a speed of approximately 176 Kbit/sec. This is typically in the form of 16 separate files that have been opened (with 11 Kbits/sec of data going to each file). I originally found that streaming the data to DOC caused a large "blip" in the CPU usage at various times (could be after 1 min or 10 mintes or 45 minutes). This "blip" was detected by running "top" on the system, and the DOC driver would end up using 99% or the CPU cycles during this blip which lasted about 20 seconds or so. Since the DOC driver runs at a higher priority (-20) than my application (0), it essentially locked up the rest of the system and which caused an eventual failure in the system due to data buffers overflowing.
I then attempted to store the streaming data to the CF card, thinking the IDE driver for the CF card may work better than the DOC driver. I am using a 4 GB CF card. However, I am finding the same anomoly, where the system seems to lock up while data is being synched to disk, which consequently causes data to overflow in the collection buffers in my application.
I have tried several different methods of actually storing the data to disk:
-calling fwrite() after every 16 bytes on each of the 16 files
-buffering up 4K per stream in a RAM buffer, then calling fwrite for the 4K...one of the problems here is that all the writes happend almost simultaneously, which took a long time
-buffering up 64K in a RAM buffer, then calling fwrite for the
64K...same as above, but the disk writes were hugeI am wondering if there are other ideas/solutions to enable me to stream ~176 Kbits/sec to either DOC or (preferably) CF. Stepping back for a moment...am I crazy for thinking this should work OK?The CF specs claim Megabytes/sec throughput, so this shouldn't be the limiting factor. This system would be looking to sustain this transfer rate (176 Kbits/sec broken up into 16, 11 Kbits/sec streams to files) for hours on end (it can go for a long time with a 4 GB CF card). What do you think?
If you've made it this far, my personal thanks for reading. Any help is appreciated here. Let me know if I can provide any other details that would help.
Regards, John O.