I have recently been reevaluating my filesystem and disk drive interface. Right now my buffer sizes are as follows
Hard Disks: 128kb
Floppy Disks: ~90kb
I was just wondering if these sound a little small or a little big, by the way these numbers are per drive. Also what is a good size for the buffers for the filesystems.
Buffer size
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
buffer size depends on the filesystem as well: IIRC systems like XFS tends to use far larger buffers than FAT (due to scheduling). Also, you can use unused memory as disk cache: i.e. increase the buffer size when lots of memory is available, and decrease it when memory becomes scarce.
</theoretical rambling>
</theoretical rambling>
The DMA buffer for a floppy drive maxes out at one page (=64K). However, the floppy can really only transfer one cylinder at a time (= 18 sectors = 9k). Two 9K buffers = 18K ought to cover any possible floppy transfer.
For a hard disk, I think 128K to 1M for the total buffer space sounds fine. Memory is precious, but the data comes off a drive pretty fast, and your kernel really can't service it all THAT often.
For a hard disk, I think 128K to 1M for the total buffer space sounds fine. Memory is precious, but the data comes off a drive pretty fast, and your kernel really can't service it all THAT often.
Ok, then I guess my next question is, how do I make the hard drive and floppy drive accesses faster? I already use DMA on the floppy drive and I haven't messed with any thing on the hard drive(other than reseting it).bewing wrote:The DMA buffer for a floppy drive maxes out at one page (=64K). However, the floppy can really only transfer one cylinder at a time (= 18 sectors = 9k). Two 9K buffers = 18K ought to cover any possible floppy transfer.
For a hard disk, I think 128K to 1M for the total buffer space sounds fine. Memory is precious, but the data comes off a drive pretty fast, and your kernel really can't service it all THAT often.