lotus

previous page: 10.05.  What does an ATA-2 interface do?
  
page up: Enhanced IDE/Fast-ATA/ATA-2 FAQ
  
next page: 10.07.  What is LBA?

10.06. What is Block mode?




Description

This item is from the Yet Another Enhanced IDE/Fast-ATA/ATA-2 FAQ, by John Wehman and Peter den Haan with numerous contributions by others. (v1.92).

10.06. What is Block mode?

Multiple Read/Write commands (reduces Interrupts to host processor).

Besides the obvious transfer increase, Fast-ATA and many other drives allow for Read/Write Multiple commands, which increase the number of sectors passed without intervening interrupts. This lessens the host's overhead, as every interrupt causes the CPU to do a context switch, check the device and set up the data transfer (or perform the transfer itself in the case of PIO).

The Read Multiple Command (0C4h) and the Write Multiple Command (0C5h) are drive-level commands that can transfer multiple sectors of data without asserting the IRQ line of the drive, signaling the processor that a drive operation is pending.

The IRQ line is asserted when:

o A read command has been issued, and the requested data is in the drive's buffer, ready to be taken by the host.

o A write command has been issued, and the data has transferred to the drive's buffer. If write caching is disabled, the IRQ won't be asserted until the data has been completely written to the media.

During normal reads and writes, the interrupt can constantly bother the CPU, and depending on the processor and the task at hand (multi- tasking OS, Unix, etc), there can be long delays in having the CPU service the drive. The advent of Read/Write Multiple allows many sectors (from 2 up to as many as 128) to be transferred in one go, completing the task in as much as 30% faster times.

On single-tasking operating systems like DOS, any improvement over a few percent usually indicates bad buffer cache management on the part of the drive.

Warning: some old drives have a buggy block mode implementation and may corrupt data.

A final remark: the block size that is optimal for drive throughput doesn't have to be the best for system performance! For example, the DOS FAT filesystem tends to favor a block size equal to the cluster size. Do not trust low level benchmarks when tweaking the block size, but use an application level benchmark suite instead.

 

Continue to:













TOP
previous page: 10.05.  What does an ATA-2 interface do?
  
page up: Enhanced IDE/Fast-ATA/ATA-2 FAQ
  
next page: 10.07.  What is LBA?