How to make faster

tux_compThe make tool can run jobs (commands) simultaneously instead to running them one by one. Works best on multiprocessor systems. To enable it, run:

$ make -j n

where n is the number of parallel jobs to execute. As per this analysis, the results are best when n = number of processors in the system.

This speeds up the compilation of large source code like that of the Linux kernel. As Bob has mentioned in his comment below, not all Makefiles are “job safe” and the jobs may be completed in any order. So be cautious when using the -j option.

BFS: kernel with aggressive context switch

tux_compBFS is an unofficial scheduler for the Linux kernel to ‘boost’ the responsiveness by increasing the context witch rate. Here’s the writeup on BFS from the author posted yesterday:
BFS: A Kernel Patch (new ‘Task Scheduler’)

To install and test the BFS scheduler on Ubuntu 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04 Natty Narwhal and 10.10:

$ sudo add-apt-repository ppa:chogydan/ppa
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-ck linux-headers-generic-ck

Some Linux system debugging methods

technicalFind a nice Linux debugging tutorial using straceltrace and vmstat here:
Linux system debugging super tutorial

Another article on shared library debugging:
Linux Commands For Shared Library Management & Debugging Problem

An article on memory corruption debugging:
Memory Corruption – Debugging Tools in Linux

A nice tutorial on how to debug the kernel by printing:
Debugging by printing

Blacklist modules on Ubuntu

By default the kernel loads some modules which may not be required by your laptop/computer. I have disabled all the modules on Ubuntu 12.04 other than those related to sound, network and graphics to speed-up boot time. To stop modules from loading add them in the /etc/modprobe.d/blacklist.conf file. Here goes my configuration. Several modules can be specific to your hardware. For example, I keep the laptop webcam disabled.

$ cat /etc/modprobe.d/blacklist.conf
#apj added
blacklist btusb
blacklist joydev
blacklist bluetooth
blacklist rfcomm
blacklist bnep
blacklist uvcvideo
blacklist videodev
blacklist v4l_compat_ioctl32
blacklist lp
blacklist parport
blacklist btrfs
blacklist ufs
blacklist qnx4
blacklist hfsplus
blacklist hfs
blacklist minix
blacklist vfat
blacklist msdos
blacklist jfs
blacklist xfs
blacklist reiserfs
blacklist ext2
blacklist zlib_deflate
blacklist libcrc32c
  • To disable the printer modules lp and parport, blacklisting lp is not enough. Comment (#) out the entry for lp in /etc/modules file.
  • To disable IPv6 add the following to GRUB_CMDLINE_LINUX_DEFAULT as a kernel boot parameter to /etc/default/grub (as root):

    OR add the following in sysctl.conf

    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1

    and run

    $ sudo sysctl -p
  • At any time, to find out more about a module try the following (or Google the module name):
    $ modprobe modulename