4. Raw I/O Variable-Size Optimization Patch

This section provides information on the raw I/O variable-size optimization patch for the Linux 2.4 kernel written by Badari Pulavarty. This patch is also known as the RAW VARY or PAGESIZE_io patch.

The raw I/O variable-size patch changes the block size used for raw I/O from hardsect_size (normally 512 bytes) to 4 kilobytes (K). The patch improves I/O throughput and central processing unit (CPU) utilization by reducing the number of buffer heads needed for raw I/O operations.

4.1. Locating the Patch

You can download the patch from one of the following locations:

4.2. Modifying Your Driver for the Raw I/O Variable-Size Optimization Patch

Modifications are required for all device drivers using version 2.4.17 patch. However, rebuilding device drivers is beyond the scope of this document. Additional information is available at http://www.xml.com/ldd/chapter/book/index.html.

In previous versions of this patch, changes were enabled for all drivers. However, the 2.4.17 and later versions of the patch enable only the changes for the Adaptec aic7xxx and the Qlogic ISP1020 SCSI drivers. All other drivers for version 2.4.17 must be modified to make use of the patch.

You will need to modify the code as follows:

Set the can_do_varyio bit in the Scsi_Host_Template structure before calling scsi_register ( ).

Important

Drivers that have the raw I/O patch enabled must support buffer heads of variable sizes (b_size) in a single I/O request because hardsect_size is used until the data buffer is aligned to the 4 K boundary.