<HTML ><HEAD ><TITLE >Raw I/O Variable-Size Optimization Patch</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ "><LINK REL="HOME" TITLE="I/O Performance HOWTO" HREF="index.html"><LINK REL="PREVIOUS" TITLE="Avoiding Bounce Buffers" HREF="overview.html"><LINK REL="NEXT" TITLE="I/O Request Lock Patch" HREF="x191.html"></HEAD ><BODY CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >I/O Performance HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="overview.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="x191.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="AEN159">4. Raw I/O Variable-Size Optimization Patch</H1 ><P >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. </P ><P >The raw I/O variable-size patch changes the block size used for raw I/O from <TT CLASS="structfield" ><I >hardsect_size</I ></TT > (normally 512 bytes) to 4 kilobytes (K). The patch improves I/O throughput and CPU utilization by reducing the number of buffer heads needed for raw I/O operations.</P ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="AEN164">4.1. Locating the Patch</H2 ><P >You can download the patch from one of the following locations:</P ><P ></P ><UL ><LI ><P >Andrea Arcangeli has made the patch available at <A HREF="http://www.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.18pre7aa2/" TARGET="_top" >http://www.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.18pre7aa2/</A >. The name of the file is <EM >10_rawio-vary-io-1</EM >.</P ></LI ><LI ><P >Alan Cox has included the patch in the <EM >2.4.18pre9-ac2</EM > kernel patch. The patch is available at <A HREF="http://www.kernel.org/pub/linux/kernel/people/alan/linux-2.4/2.4.18/" TARGET="_top" >http://www.kernel.org/pub/linux/kernel/people/alan/linux-2.4/2.4.18/</A >. </P ></LI ><LI ><P >The patch is available from SourceForge at <A HREF="http://sourceforge.net/projects/lse/io" TARGET="_top" >http://sourceforge.net/projects/lse/io</A >. The latest version is <EM >PAGESIZE_io-2.4.17.patch</EM >.</P ></LI ></UL ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="AEN180">4.2. Modifying Your Driver for the Raw I/O Variable-Size Optimization Patch</H2 ><P >In previous versions of this patch, changes were enabled for all drivers. However, the 2.4.17 and later versions of the patch enable the changes only for the Adaptec, Qlogic ISP1020, and IBM ServerRAID drivers. All other drivers for version 2.4.17 and later must be modified to make use of the patch by setting the <TT CLASS="structfield" ><I >can_do_varyio</I ></TT > bit in the <TT CLASS="structfield" ><I >Scsi_Host_Template</I ></TT > structure.</P ><DIV CLASS="note" ><P ></P ><TABLE CLASS="note" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="../images/note.gif" HSPACE="5" ALT="Note"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >Drivers that have the raw I/O patch enabled must support buffer heads of variable sizes <TT CLASS="structfield" ><I >(b_size)</I ></TT > in a single I/O request because <TT CLASS="structfield" ><I >hardsect_size</I ></TT > is used until the data buffer is aligned on a 4 K boundary.</P ><P >Additional information is available on rebuilding Linux device drivers at <A HREF="http://www.xml.com/ldd/chapter/book/index.html" TARGET="_top" >http://www.xml.com/ldd/chapter/book/index.html</A >.</P ></TD ></TR ></TABLE ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="overview.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="x191.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Avoiding Bounce Buffers</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >I/O Request Lock Patch</TD ></TR ></TABLE ></DIV ></BODY ></HTML >