Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    How to speed up linux kernel compilation?

    I have core i5 with 8gb RAM. I have VMware workstation 10.0.1 installed on my machine. I have fedora 20 Desktop Edition installed on VMware as guest OS.

    I am working on linux kernel source code v 3.14.1. I am developing an I/O scheduler for linux kernel. After any modifications in code every time it takes around 1 hour and 30 minutes for compiling and installing the whole kernel code to see the changes.

    Compilation and Installation commands:
    make menuconfig
    make modules
    make modules_install
    make install

    So my question is it possible to reduce 1 hour and 30 minutes time into only 10 to 15 minutes?

    Any help would be greatly appreciated!

    Thanks, momersaleem

  2. #2
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Woodshed, CA
    That's way longer than most say a kernel compile takes. most says under hour, usually 10-30 minutes. Are you compiling in the VM then how is it configured, plus overhead of virtual storage. Other thing that I wonder is the make system working it should only be compiling the changed files, then relink. It's acting like something is "touching" the files forcing complete rebuild.
    A lion does not lose sleep, over the opinion of sheep.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    How many cores does your system have? My has 8, so I run make with the "-j 8" option which will turn a 2 hour compilation into 15 minutes! That option tells make how many threads to use to build sub-components. It isn't quite linear, but it is close! If my system is running a bunch of other tasks, then I will use "-j 4" and just use 4 cores to build the kernel modules, leaving plenty of CPU for other stuff.

    And to docbop, my system without the "-j N" option will take about 2 hours to build a full RHEL kernel, and I have 8GB RAM, dual quad-core 3GHz Intel processors, and fast sata drives. I grant the system is 6+ years old, but it still keeps up with most newer systems.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. $spacer_open
  5. #4
    1. edit your .config file (via menuconfig for example) - remove all unused modules and kernel features.
    2. make -j 9
    3. don't compile modules and don't install the kernel(make install). use qemu to run the compiled kernel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts