<HTML ><HEAD ><TITLE >Compiler Speed-up</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.63 "><LINK REL="HOME" TITLE="Linux Kernel Modules Installation HOWTO" HREF="index.html"><LINK REL="PREVIOUS" TITLE="Pre-requisites" HREF="require.html"><LINK REL="NEXT" TITLE="Recompiling the Kernel for Modules" HREF="kernel.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Linux Kernel Modules Installation HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="require.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="kernel.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="SPEEDUP" >3. Compiler Speed-up</A ></H1 ><P > If your machine has 16 or more Megabytes of RAM, there is a useful speed-up that can be done, which is to permit the kernel to compile two or modules in parallel. This will increase the load on the machine whilst the kernel is being recompiled, but will reduce the time during which the compilation will be taking place. </P ><P > Before you can use this method, you need to check the amount of RAM present in your machine, as if you set this too high, the compilation will actually slow down. Experience has shown that the optimum value depends on the amount of RAM in your system according to the following formula, at least for systems with up to 32 Megabytes of RAM, although it may be a little conservative for systems with larger amounts of RAM: </P ><P > N = [RAM in Megabytes] / 8 + 1 </P ><P > For the benefit of those with a dislike of math, the values for the common amounts of RAM are as follows: </P ><P > <DIV CLASS="TABLE" ><A NAME="AEN48" ></A ><P ><B >Table 1. Sample Table</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><THEAD ><TR ><TH WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >RAM Size</TH ><TH WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >Value to Use</TH ></TR ></THEAD ><TBODY ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >16 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >3</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >24 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >4</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >32 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >5</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >40 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >6</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >48 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >7</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >56 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >8</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >64 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >9</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >80 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >11</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >96 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >13</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >112 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >15</TD ></TR ><TR ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >128 Megs</TD ><TD WIDTH="50%" ALIGN="LEFT" VALIGN="TOP" >17</TD ></TR ></TBODY ></TABLE ></DIV > </P ><P > When you have decided on the correct number, edit the file <TT CLASS="FILENAME" >/usr/src/linux/Makefile</TT > and find the line that currently reads: </P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" >MAKE=make </PRE ></FONT ></TD ></TR ></TABLE ><P > Replace it with one reading: </P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" >MAKE=make -j N </PRE ></FONT ></TD ></TR ></TABLE ><P > where <TT CLASS="VARNAME" >N</TT > is the number determined above. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="require.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="kernel.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Pre-requisites</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Recompiling the Kernel for Modules</TD ></TR ></TABLE ></DIV ></BODY ></HTML >