FAT thrashing...



I'm working on optimizing our BSP (Xscale) and app and have run into an
odd problem that has me stumped.

The app is writing 128KB chunks of audio to disk (CF) via a customized
driver we wrote. It's writing at a rate of about 1.1MB/sec. A logic
analyzer instrumented to the read/write sections of the driver shows
that the file system does a read about once a second.

After running for a while, 5 to 10 minutes (depends on size/speed of
disk), it suddenly starts doing a bunch of reads (~30) before every
128KB block. Putting a breakpoint in and viewing the stack I see:

(etc...on down to our driver)
FSDMGR!PartitionIoControl() line 28 + 60 bytes
FSDMGR!FSDMGR_DiskIoControl() line 568 + 68 bytes
FATFSD!ReadWriteDisk2() line 517 + 60 bytes
FATFSD!ReadWriteDisk() line 258 + 44 bytes
FATFSD!ReadVolume() line 88 + 104 bytes
FATFSD!FindBuffer() line 1036 + 32 bytes
FATFSD!ReadStreamBuffer() line 1236 + 96 bytes
FATFSD!GetFAT() line 86 + 28 bytes
FATFSD!Unpack16() line 327 + 28 bytes
FATFSD!UnpackRun() line 540 + 32 bytes
FATFSD!WriteStreamData() line 1019 + 8 bytes
FATFSD!FATFSWriteFile() line 492 + 40 bytes
FATFSD!FAT_WriteFile() line 788 + 44 bytes
FSDMGR!FSDMGR_WriteFile() line 933 + 56 bytes
COREDLL!xxx_WriteFile() line 80 + 36 bytes
OUR_APP!hdRiff::Write() line 143 + 48 bytes


We are setup to use FATFSD with cache disabled. Furthermore the files
are created with the following flags:

FILE_FLAG_WRITE_THROUGH |
FILE_FLAG_SEQUENTIAL_SCAN |
FILE_FLAG_NO_BUFFERING

Everything works perfect up to the 5 or 10 minute mark with the FAT
starts thrashing. If I close the file and immediately open a new one
it will run fine for another 5 or 10 minutes.

The disks aren't fragmented and this is the only disk activity going
on.

Any ideas?

Thanks!

-Jerry

.



Relevant Pages

  • Re: X-CD Roast question again please
    ... Using generic SCSI-3/mmc CD-R driver. ... Disk sub type: Medium Type A, ... ATIP start of lead in: -11318 ... writing 152 KB of pad data. ...
    (RedHat)
  • Re: Scanning service or DIY?
    ... >at the time of writing. ... I see Nero Ultra has added the ability to do an analysis on a written ... tests including the standard read and seek times, but disk quality, ... I don't know how well this app will compare to some of the other test ...
    (comp.periphs.scanners)
  • Re: FAT thrashing...
    ... > The app is writing 128KB chunks of audio to disk via a customized ... > driver we wrote. ... It's writing at a rate of about 1.1MB/sec. ... > Everything works perfect up to the 5 or 10 minute mark with the FAT ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Ruby Scales just fine !
    ... I mean, if the language is ... only being executed 1% of the time and the disk light is on 99% of the ... If I am writing an app that needs to write to disk transactionally, then the significant latency involved in writing to disk is just as much of an issue today as it was in "ancient" times. ...
    (comp.lang.ruby)
  • IM driver: How check if ZwWriteFile has completed?
    ... I am writing large amounts of data to disk from an intermediate driver, using ZwWriteFile. ... In some cases, there is too much data for the disk to keep up, so I need to detect this and throw some data away. ... My thread must keep working on other stuff while writing to disk, so just sleeping until it's done is not acceptable. ...
    (microsoft.public.development.device.drivers)

Quantcast